lukasgeiter / mkdocs-awesome-pages-plugin

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

Sub-subdirectories not supported? #104

Open eXpl0it3r opened 3 months ago

eXpl0it3r commented 3 months 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 3 months ago

+1 for this question

kamilkrzyskow commented 3 months 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 3 months ago

@kamilkrzyskow is there a workaround for it?

kamilkrzyskow commented 3 months 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.