#1223·starlight

Sidebar folders order depends on their page order property

Author: cbontemsCreated Dec 4, 2023Updated Feb 17, 2026
Labels🌟 core

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.