The sidebar
The sidebar is set in astro.config.mjs. This template uses one group per
folder:
sidebar: [ { label: 'Start here', items: [{ autogenerate: { directory: 'start-here' } }] }, { label: 'Writing', items: [{ autogenerate: { directory: 'writing' } }] }, { label: 'Publishing', items: [{ autogenerate: { directory: 'publishing' } }] }, { label: 'Reference', items: [{ autogenerate: { directory: 'reference' } }] },],Each group’s autogenerate lists every page in that folder, so adding a page
is adding a file. The group’s label is what readers see; the directory is the folder
under src/content/docs/.
Ordering pages
Section titled “Ordering pages”Within an autogenerated group, pages are sorted by sidebar.order in their
frontmatter, then alphabetically:
---title: Installing the CLIsidebar: order: 1---Adding a group
Section titled “Adding a group”Create the folder, put a page in it, and add a line to the list:
{ label: 'Guides', items: [{ autogenerate: { directory: 'guides' } }] },Groups appear in the order they are listed.
Listing pages by hand
Section titled “Listing pages by hand”When you want full control — or a link to somewhere outside the docs — list the entries yourself instead of autogenerating:
{ label: 'Start here', items: [ 'start-here/introduction', 'start-here/use-this-template', { label: 'Changelog', link: 'https://github.com/your-org/your-repo/releases' }, ],},Pages are named by their path under src/content/docs/, without the extension.
Deployed on One9x Pages