Is it possible to use navigation expansion only for sub-sections? #5051
Unanswered
StarfallProjects
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I've not come up with an idea how this should work. Sections normally don't have pages associated with them, except for when you use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Material supports automatic navigation expansion: https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#with-expansion
I'd like to have the nav start out collapsed, but when a user clicks on a section, the section and all sub-sections expands.
For example:
I tried with partial overrides, overriding nav-item.html and changing it as follows, but encountered errors and am not sure this is the right approach anyway:
Then adding expandSection:true to the frontmatter of the landing page of the section I wanted to expand.
However, I got the error
nav_item is undefined
. Interestingly, I got this error even without making any changes (just copying the existing nav-item.html into overrides)Beta Was this translation helpful? Give feedback.
All reactions