Hey there. I’m trying to figure out if it’s possible to organize pages under a section but have the section header really only used for expanding the section on the menu.
More concretely, suppose I have the following site layout:
What I would like is for my navigation menu to still show “Posts” and “Articles,” and expand to show their subpages when possible. However, I would like for the “Posts” and “Articles” entries in the menu to not redirect anywhere.
I did find these _index.md Build Options when searching for similar topics:
[_build]:
render: never
list: never
When I set this it removes the section from the navigation entirely, rather than making the section header just used for expanding that section of the menu. Is there a way to accomplish this?
Are you creating the section menu by ranging over site.Menus.xxx, or are you recursively walking the sections? The latter is scalable (just create a new page) and less error-prone.
I’m using the “Learn” theme, and it looks like it is just iterating over .Site.Home.Sectionshere. I suppose the solution is to create my own menu.html partial to overwrite this behavior then, right? It seems like each <ul> under a section is set to display: none; if the section is not selected, and display: block; if it is selected. Would the solution here be to make each section header toggle the visibility of its <ul> child rather than redirecting to /section?
I’m not 100% sure what you’re asking… if I was looking at post-one I would expect the full URL to be /posts/post-one, but just that /posts itself doesn’t really point to anything.