Developer tips & trick, one bite at a time

How to create a new file in astro

To create a new file in astro site generator, we just need to create a new file inside pages folder with .astro extension


|_ src
    |_ pages
        |_ index.astro (default)
        |_ yournewfile.astro

Now you can visit in your URL localhost:3000/yournewfile

Astro automatically pick the file name as your route path

“Astro Components (.astro) and Markdown Files (.md) in the src/pages directory automatically become pages on your website.” - astro routing

🏊🏾‍♀️ Back Home