lukasgeiter / mkdocs-awesome-pages-plugin

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

Combining custom navigation file structure does not work? #40

Closed ultrabug closed 3 years ago

ultrabug commented 3 years ago

Hi, thanks for this cool plugin!

https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin/#combine-custom-navigation--file-structure

It looks to me like this does not work on current version (looks like there's a typo on summary.md as well).

If I create:

docs
├── folder
│   ├── introduction.md
│   ├── page3.md
│   └── page4.md
├── introduction.md
├── page1.md
└── page2.md

I get:

TypeError: Invalid nav item format {'Start': ['page1.md', 'page2.md', 'introduction.md']} [/home/alexys/github/mkdocs-awesome-pages-plugin/docs/.pages]

Can you confirm it's a bug or am I missing something please?

lukasgeiter commented 3 years ago

This feature is about enhancing MkDocs' navigation config. Therefore the code goes into mkdocs.yml and not a .pages file. See the following paragraph in the README:

Use the nav entry in mkdocs.yml to define the custom part of your navigation. Include a ... entry where you want the navigation tree of all remaining pages to be inserted.


Thanks for letting me know about summary.md!

ultrabug commented 3 years ago

@lukasgeiter ohhh it didn't strike me as such, sorry for the noise then :)

On a side note, this means that this feature is not possible for other places (might be cool to add?)

lukasgeiter commented 3 years ago

The idea behind the .pages file is to mainly use the file system to define the navigation structure and only use the .pages file for some tweaks here and there. Allowing .pages files to customize the whole navigation subtree comes with a significant increase in complexity. That said, I'm always open for suggestions. In particular, I would be interested in your use case and how this feature would help you.

ultrabug commented 3 years ago

The idea behind the .pages file is to mainly use the file system to define the navigation structure and only use the .pages file for some tweaks here and there.

That's good enough I understand your point. No need to add complexity since it fixed my initial problem :+1:

Thanks again Lukas