Astro · Routing and content

Create pages from files

Files in src/pages become routes. [slug] is a dynamic segment.

src/pages/index.astro          # /
src/pages/about.astro          # /about
src/pages/blog/[slug].astro    # /blog/anything

Official Astro documentation

More routing and content commands

All routing and content commands · Astro cheatsheet

Was this page helpful?