shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.

Home Page:https://nextra.site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hiding folder directory from sidebar whilst keeping subfolders

jobiewong opened this issue · comments

Is it possible to hide a parent directory from the sidebar without also hiding its children?

Currently, setting "display": "hidden" to the parent directory hides all sub-files/directories. It is possible to re-add them manually, but I want to avoid having to do this.

The purpose of this behaviour would be to reduce the number of unnecessary indentation levels in the sidebar in favour of separating our sections with titles and separators.

@jobiewong, set "display" : "children"

Thanks! That achieves the desired effect. However, if sub-folders/files share the same names as sibling folders duplicate entries in the sidebar appear and the console displays key errors. Is there a way to define IDs in the _meta.json explicitly rather than directly using the file name?

There's a workaround here: #2557 (comment), granted it's not a long-term solution.