Supplementing generated navigation #4142
stevegroom
started this conversation in
General
Replies: 1 comment 1 reply
-
I did find a cosmetic issue - the new link has a bullet point and line break when rendered in Chrome and appears without bullet on FireFox. Considering that it is a difference between browsers, is this a mkdocs, material or my own bug ? Steve |
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.
-
I have a large document with generated navigation. I wanted to add to the side bar a few manual links - specifically to external addresses. Creating Nav elements in
mkdocs.yml
works, but requires that all navigation links are created manually there and I am not happy with the risk of missing changes to the navigation elements over time.To address this, I used the overrides feature to insert external navigation links before or after the generated links.
Create
docs/overrides/partials/nav.html
copied fromhttps://github.com/squidfunk/mkdocs-material/blob/master/src/partials/nav.html
I then added two blocks of code - look for 4 x override below:
These blocks then loop over any override made in mkdocs.yml in the extra section:
This seems to work for me, but I don't understand what is going on behind the scenes so might be mistaken.
Do you consider this to be the right approach?
Do you have any tips on how best to be aware when the original nav.html that file I copied is maintained so that I might update my override version in a timely manner?
Steve
Beta Was this translation helpful? Give feedback.
All reactions