-
I would like to have a nav: section to control the top level nav for the site. But, for a certain subdirectory, I will be happy to list all the .md files in alpha order. What I read in the doc was that it is either all or nothing. Leave a nav: section off, and you will get all the subdirectories and their content in alpha order. Include a nav: section and you have to list each file separately. Googling (and AI) didn't help because I get answers from older versions of Mkdocs. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Interesting. This plugin seems to be a good candidate: https://github.com/mysiki/mkdocs_include_dir_to_nav. It wasn't updated recently, so if it doesn't work you can try to copy/paste its code in your own hooks and adapt to your needs. You can also checkout other plugins related to navigation here: https://github.com/mkdocs/catalog/?tab=readme-ov-file#-navigation--page-building. |
Beta Was this translation helpful? Give feedback.
-
Since this is achievable through plugins, I don't think the feature should be implemented directly in MkDocs. Therefore I'm gonna move this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Ah, it's probably possible to use mkdocs-gen-files in combination with mkdocs-literate-nav to generate SUMMARY.md files in each directory so that their contents are included into the navigation. |
Beta Was this translation helpful? Give feedback.
-
This is directly supported by this plugin: |
Beta Was this translation helpful? Give feedback.
This is directly supported by this plugin:
https://oprypin.github.io/mkdocs-literate-nav/#mkdocs-native-nav-with-inferred-subdirectories