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.