lukasgeiter / mkdocs-awesome-pages-plugin

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

order_by title does not work with folder #73

Closed ChrisBlankDe closed 1 year ago

ChrisBlankDe commented 1 year ago

the new order_by feature works great with multible files in one directory. Thank you!

But the new feature does not work with directories:

directory tree:

│   mkdocs.yml
└───docs
    │   .pages
    │   index.md
    ├───1
    │       .pages (Title: A (1))
    │       index.md
    ├───2
    │       .pages (Title: C (2))
    │       index.md
    ├───3
    │       .pages (Title: B (3))
    │       index.md
    └───4
            .pages (Title: D (4))
            index.md

.pages at root level:

nav: 
  - Home: index.md
  - ... | flat
order_by: title

My expection was that the groups where sorted by name (from the .pages in sub dir: A, B, C, D) but they are sorted by the name of the directory (1, 2, 3, 4): image

My minimized demo solution: mkdocs-awesome-order-by-folder.zip

Is this behavior intentional or is it a bug?

kamilkrzyskow commented 1 year ago

This is a bug, edge case which I completely overlooked, since I'm not using the .pages file to change the title. Should probably be an easy fix, because now it's sort of ignoring the custom title from the .pages file.

kamilkrzyskow commented 1 year ago

Thanks for the reproduction @ChrisBlankDe ✌️ image

lukasgeiter commented 1 year ago

Fixed in v2.9.1