Skip to content

Creating Pages

Essentials

Creating Pages

Add new pages to your site by creating .md or .mdx files in src/content/docs/. Use sub-folders to organize your files and to create multiple path segments.

Add Files

  1. Create a new file in src/content/docs/ called hello-world.mdx.

  2. Now you can navigate to localhost:4321/hello-world and see your newly created page.

  3. To add your page to your sidebar navigation, update astro.config.mjs with:

    export default defineConfig({
    ...
    integrations: [
    starlight({
    sidebar: [
    label: 'Starmint',
    items: [
    {
    label: 'Hello world',
    slug: 'hello-world'
    }
    ]
    ]
    })
    ]
    })

You can now navigate to localhost:4321/hello-world to see your newly created page!

File Tree Preview

  • Directorysrc
    • Directorycontent
      • Directorydocs
        • hello-world.mdx