Hide page in nav, but render specific nav when page is open #8476
Unanswered
jpluscplusm
asked this question in
Q&A
Replies: 0 comments
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.
-
I'm in a similar position to the user who asked "Can pages be hidden from navigation?" in #5856. In that discussion, the user asks how to omit a page from the nav, as their docs site has a large number of pages that make a fully populate nav unwieldy.
I have the same need, but with an additional wrinkle: when such a page (unmentioned in the nav) is open, I'm trying to work out how to render the page's nav as if it were mentioned at a specific location.
As an example, imagine a site with a top-level hierarchy like this:
When the Guides section is selected, the
navigation.indexesfeature jumps to the section index doc, and the nav becomes this:> Home > About v Docs > Introduction v Guides + > About these guide + > Popular guides > ReferencesThe above is all possible (and working!) with Material for MkDocs 😄
Here's what I'm trying to achieve: when an individual guide is being viewed I'd like the nav to act as if the page were inside the Guides section, instead of just displaying the top-level nav view. In other words, to display the same nav AS IF the Guides section index were being viewed.
I've been unable to configure this in vanilla, plugin-less Material for MkDocs.
I'm currently trying to configure
mkdocs-awesome-navto achieve this, but its page hiding feature seems to place an "ignored" page (i.e. the individual guide, above) in the same limbo state as the vanilla setup - where only the top-level, default nav is displayed.Has anyone needed this and figured out a solution?
Does anyone else have any ideas that might help?
Beta Was this translation helpful? Give feedback.
All reactions