lukasgeiter / mkdocs-awesome-pages-plugin

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

Toplevel .pages is not being picked up (resulting in wrong order of toplevel nav bar entries) #16

Closed maxalbert closed 4 years ago

maxalbert commented 4 years ago

First of all, thanks for this awesome plugin! It has already saved my day. :)

I'm having trouble arranging the order of the toplevel entries in the navigation bar.

My docs folder looks like this:

docs/
├── .pages
├── how_to_guides
│   ├── .pages
│   ├── running_the_tests.md
│   └── setting_up_a_dev_environment.md
└── tutorials
    └── first_steps.md

I would like the entries in the navigation bar to appear in the following order:

Tutorials
  - First steps
How-To Guides
  - Setting up a dev environment
  - Running the tests

To achieve this, I have two .pages files (one at the toplevel and another one inside the how_to_guides folder). These look as follows:

$ cat docs/.pages
arrange:
  - tutorials
  - how_to_guides

$ cat docs/how_to_guides/.pages 
arrange:
  - setting_up_a_dev_environment.md
  - running_the_tests.md

Now, the file how_to_guides/.pages is picked up correctly by the plugin, so the order of the two entries "Setting up a dev environment" and "Running the tests" (underneath "How-To Guides") ends up being correct.

However, it seems that the toplevel .pages file is not being picked up by the plugin, and so the order of "Tutorials" and "How-To Guides" ends up being the wrong way around.

Is this a bug or am I missing something obvious? Many thanks for any help!

lukasgeiter commented 4 years ago

Using a .pages file in the root to arrange the toplevel navigation entries should work just fine. I've just tested it locally and had no issues changing the order of the items in the navigation bar.

In the code / structure you've posted I don't see any mistakes. Would you be able to share the full code for a minimal example that reproduces the issue?

maxalbert commented 4 years ago

Many thanks for the quick reply! I actually just tried to reproduce this myself with a minimal example - sometimes it worked and sometimes it didn't, which was very confusing.

But after further experimentation I finally managed to isolate the bug, and it is actually due to a different plugin (mktheapidocs), which I think internally sorts the keys and this seems to shake up the order when it is used in combination with awesome-pages.

So I think we can close this issue as everything works fine if I use awesome-pages on its own. I'll file a separate bug with mktheapidocs. Apologies for the noise and thanks again for you help! Keep up the good work. :)