Skip to content

Creating a category

How to create a sidebar category for new games or forms of content.

If you want to create a new category on the sidebar, say for a new game like HNA/HYG, then you can edit the astro.config.mjs file to add the new category like so:

astro.config.mjs
export default defineConfig({
integrations: [
starlight({
sidebar: [
/// ...
{
label: 'New Category',
autogenerate: { directory: 'category-folder-name' },
},
/// ...
],
}),
],
});

Then you want to create a folder in the src/content/docs directory with the name of the category you specified in the autogenerate property, like so:

  • Directorysrc
    • Directorycontent
      • Directorydocs
        • Directorycategory-folder-name
  • astro.config.mjs

This will automatically generate a sidebar category with the label you specified, and it will autogenerate the sidebar items based on the files in that folder. Just add .md and .mdx files to add content to view and they should appear automatically.