Make a nav: subcategory always collapsed #6442
-
Hello, is it possible to indicate for a section of mkdocs.yml:nav to always be collapsed while keeping others opened? e.g this Linux category: firefox_Ala7q1ms0M.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, We do so on the Gothic Modding Community Page: The navigation.expand feature changes the indeterminate attribute as fas as I understand.
|
Beta Was this translation helpful? Give feedback.
Hello,
I don't think so. Once you enable the
navigation.expand
feature every navigation section will get expanded.However, you could disable that feature, and later add your own code to manage navigation expansion.
https://squidfunk.github.io/mkdocs-material/customization/#additional-javascript
We do so on the Gothic Modding Community Page:
https://github.com/Gothic-Modding-Community/gmc/blob/dev/overrides/assets/javascripts/extra.js#L151-L196
However, I'm not sure if the code is the best, as it changes the
checked
state of the input elements, and perhaps this should be limited to only the active navigation element 🤔mkdocs-material/src/templates/assets/javascripts/patches/indetermina…