#sidebar items not ordered
8 messages · Page 1 of 1 (latest)
Hi @tall oasis. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
By default, Starlight’s autogenerated sidebar groups are ordered alphabetically by file slug/filename. [Autogenerated groups; Sidebar sorting]
Key points to check:
-
Autogenerated groups only
Alphabetical sorting applies when you useautogenerate:starlight({ sidebar: [ { label: 'Constellations', autogenerate: { directory: 'constellations' }, }, ], });This will sort pages in that directory alphabetically by slug/filename. [Autogenerated groups]
-
Manual
itemsare not auto‑sorted
If you defineitemsyourself, Starlight keeps the order you specify:{ label: 'Constellations', items: [ 'constellations/centaurus', 'constellations/andromeda', ], }This will show
CentaurusbeforeAndromedabecause that’s the order in the array. [Groups] -
Per‑page ordering in autogenerated groups
Within autogenerated groups, you can override the default alphabetical order using frontmatter:--- title: My page sidebar: order: 1 # lower = higher in the list ---
If your items still appear “unsorted,” the most likely causes (based on the docs) are:
- You’re using manual
itemsand expecting automatic sorting. - You’re using
sidebar.orderin frontmatter, which intentionally overrides the alphabetical default in autogenerated groups.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@tall oasis Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@keen lion Can I somehow specifiy to automatically sort it alphabetically?
Let me check the knowledge base for you again. One moment! :books:
The knowledge sources only state that autogenerated groups are sorted alphabetically by default; they do not mention any option to auto‑sort manually defined items. [Autogenerated groups; Sidebar sorting]
So, based on the docs:
autogenerate: { directory: '...' }→ items are automatically sorted alphabetically.- Manually listed
items: [...]→ order is exactly as you write them; there is no documented config to auto‑sort these alphabetically.