Skip to content

Project Structure

Typical layout:

my-astro-site/
โ”œโ”€ public/ # Static assets served at site root
โ”œโ”€ src/
โ”‚ โ”œโ”€ pages/ # Route-based pages (*.astro, *.md, *.mdx)
โ”‚ โ”œโ”€ components/ # Reusable UI components
โ”‚ โ”œโ”€ layouts/ # Page layouts
โ”‚ โ””โ”€ content/ # Content Collections (optional)
โ”œโ”€ astro.config.mjs # Astro config
โ”œโ”€ package.json # Scripts and deps
โ””โ”€ tsconfig.json # TS config (optional)

Notes:

  • Files in public/ are copied to the root of the built site.
  • Files in src/pages/ become routes based on filename.
  • Layouts live in src/layouts/ and can be shared across pages.
  • Content Collections use src/content/config.* with schema definitions.