lukasgeiter / mkdocs-awesome-pages-plugin

An MkDocs plugin that simplifies configuring page titles and their order
MIT License
471 stars 36 forks source link

Sub-subdirectories not supported? #104

Open eXpl0it3r opened 1 month ago

eXpl0it3r commented 1 month ago

Am I understanding this correctly, that sub-subdirectories are not supported?

For example I'd have the structure:

└───tutorials
    └───2.6
        ├───getting-started
        └───system

How would I address the 2.6 directory?

If I write something like the following, mkdocs just crashes:

nav:
    - Home: index.md
    - Learn:
        - tutorials/2.6
mkdocs_awesome_pages_plugin.navigation.NavEntryNotFound: Nav entry "tutorials/2.6" not found. [.pages]

Using just a subdirectory works:

nav:
    - Home: index.md
    - Learn:
        - tutorials
k3yss commented 1 month ago

+1 for this question

kamilkrzyskow commented 1 month ago

I don't think so, as the navigation and meta gathering are processed recursively, so .pages files should only have access to files on their own recursion level 🤔

k3yss commented 1 month ago

@kamilkrzyskow is there a workaround for it?

kamilkrzyskow commented 1 month ago

@k3yss I'm not sure what are your requirements. Why can't you simply create a .pages in the tutorials subdirectory that sets its own navigation structure to show 2.6 based on the example above? If tutorials has exactly one navigation item then you can use collapse: true in the tutorials/.pages file to remove the Tutorials parent section and keep only 2.6.