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
-
Create a new file in
src/content/docs/calledhello-world.mdx. -
Now you can navigate to
localhost:4321/hello-worldand see your newly created page. -
To add your page to your sidebar navigation, update
astro.config.mjswith: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