Why root level pages cannot be expanded? #7677
-
nav:
- Home: index.md
- Getting started:
- Installation: getting-started.md
- Creating your site: creating-your-site.md
......
- License: license.md
- Tutorials:
- tutorials/index.md
- "Blogs":
- tutorials/blogs/basic.md
- tutorials/blogs/navigation.md
- tutorials/blogs/engage.md
- "Social cards":
- tutorials/social/basic.md
- tutorials/social/custom.md Hello, I have a simple question. Why are root level pages not expandable? Is this by design? Here I'm using the While level 2 pages have a "expand/collapse" mark on the right to show/hide its child pages at level 3, root level pages don't have such a mark. Instead, level 2 pages are always expanded just like root level pages, there's no way to hide them and they even have the same level of indentation as root pages. I wonder why it behaves like this. In my case, I have a root level page that contains a bunch of child pages at level 2, I just want to be able to show/hide them using a "expand/collapse" mark on the right, but that doesn't seem to be supported. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
....
- License: license.md # level 1 (root)
- Tutorials: # level 1 (root)
- tutorials/index.md
- "": # level 2 <- make a dummy section here
- "Blogs": # level 3 <- move the original level 2 branch one level deeper
- tutorials/blogs/basic.md # level 4
- tutorials/blogs/navigation.md # level 4
- tutorials/blogs/engage.md # level 4 Finally I found a workaround. Knowing that level 2 pages behave the same as root level pages, I can just make a dummy empty section It seems to me that this is a limitation of mkdocs itself which just got carried over to mkdocs-material. |
Beta Was this translation helpful? Give feedback.
-
OK I figured out the solution. Once I turned off the theme:
features:
- navigation.sections The documentation clearly states that
So this is expected behavior. Sorry for missing that info when reading the documentation. |
Beta Was this translation helpful? Give feedback.
OK I figured out the solution. Once I turned off the
navigation.sections
feature everything works fine.The documentation clearly states that
So this is expected behavior. Sorry for missing that info when reading the documentation.