Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Awesome pages doesn't respect specified file order over ... pattern #55

Closed
Andre601 opened this issue Nov 22, 2021 · 8 comments
Closed

Comments

@Andre601
Copy link

I host a website listing sounds enum names for the SpigotMC project.

Now I want to use Awesome pages to not have to update all pages every time a new update releases, but I encounter a rather strange issue, where the order of the pages in the navigation is completely out of order.

My intended order is:

- Spigot 1.8.x
- Spigot 1.9.x
- Spigot 1.10.x
- Spigot 1.11.x
- Spigot 1.12.x
- Spigot 1.13.x
- Spigot 1.14.x
- Spigot 1.15.x
- Spigot 1.16.x
- Spigot 1.17.x
- Spigot 1.18.x

but the order as of now is

- Spigot 1.10.x
- Spigot 1.11.x
- Spigot 1.12.x
- Spigot 1.13.x
- Spigot 1.14.x
- Spigot 1.15.x
- Spigot 1.16.x
- Spigot 1.17.x
- Spigot 1.18.x
- Spigot 1.8.x
- Spigot 1.9.x

and I'm not sure if this is now caused by awesome pages, the Material theme or even MkDocs itself.

I tried to force awesome pages to put the 1.8 and 1.9 pages before everything else using

nav:
- Spigot Sounds: index.md
- mc-1.8.md
- mc-1.9.md
- ...

but the order stays unaffected. The file names are correct.

Any idea what the issue is and how I could solve it?

@lukasgeiter
Copy link
Owner

This is a consequence of how MkDocs sorts files/pages. They are compared character by character, without any kind of special handling for (multi digit) numbers. So when the second 1 in mc-1.10.md is compared to the 9 in mc-1.9.md, 1 is smaller and therefore mc-1.10.md is listed before mc-1.9.md.

Explicitly putting 1.8 and 1.9 before ... should've worked though. Maybe you'll want to try that again.

An alternative solution would be to add zeroes to the filenames: mc-1.08.md

@Andre601
Copy link
Author

Explicitly putting 1.8 and 1.9 before ... should've worked though. Maybe you'll want to try that again.

Yeah... That doesn't work for some reason

@lukasgeiter
Copy link
Owner

But the nav feature works for other pages?

@Andre601
Copy link
Author

But the nav feature works for other pages?

Idk.
I don't use that specific nav setups on other pages.

@lukasgeiter
Copy link
Owner

Okay, I've looked at your repo. The file needs to be called .pages (without an extension).

You're not the first person to run into this, so I might change it so it also works with an extension...

@Andre601
Copy link
Author

Strangely enough did it not work when I had only .pages

It's rather strange. And personally should it just use extensions, because of other things like syntax highlighting in text editors...

@lukasgeiter
Copy link
Owner

In hindsight I agree, having a file extension makes more sense... I'll see that I can enable support for .pages.yml out of the box.

In the meantime, you can customize the filename using a plugin option.

@Andre601
Copy link
Author

I for now changed the filenames and the nav is working as it should, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants