Skip to content

Sidebar folders order depends on their page order property #1223

Open
@cbontems

Description

What version of starlight are you using?

0.14.0

What version of astro are you using?

3.6.4

What package manager are you using?

pnpm

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

As discussed on Discord,

Structure:
 - docs/
    - category/
      - folder-1/
        - page-1.md
        - page-2.md
      - folder-2/
        - page-1.md
        - page-2.md

If I give my folder-1/page-1.md an order property of 10, and my folder-2/page-1.md an order property of 5, I end-up with my folder-2 being ranked above folder-1 in my sidebar.

Said differently, autogenerated folders are sorted according to the order of the first page in the directory.

In the stackblitz example linked below, in the fruits directory, the banana subdirectory comes before the apples subdirectory because it has a page with order 1, when apples has a page with order 5.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-dssfwv?file=src%2Fcontent%2Fdocs%2Ffruits%2Fbananas%2Flatundan.md

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions