Project Structure
Where everything lives in an Astro theme, and which directories are special.
Updated: September 2026·License: Commercial & Personal
Directory layout
text
your-theme/
├── public/ # Copied to the build as-is (favicon, fonts, images)
├── src/
│ ├── pages/ # File-based routes — every file here becomes a URL
│ ├── layouts/ # Page shells wrapped around route content
│ ├── components/ # Reusable .astro components
│ ├── content/ # Markdown and MDX collections
│ ├── styles/ # Global stylesheets and design tokens
│ └── content.config.ts # Collection schemas
├── astro.config.mjs # Astro config and integrations
└── package.jsonThe two directories that are special
src/pages/ drives routing. There is no route config — the file path *is* the URL:
| File | URL | | --
src/pages/index.astro | / |
| src/pages/about.astro | /about/ |
| src/pages/work/[slug].astro | /work/anything/ |public/ is copied to the output untouched. A file at public/logo.svg is served at /logo.svg. Put things here only when they must keep their exact filename — everything imported through src/ gets hashed and optimised instead.
Explore production-ready themes
Hand-built Astro themes — SaaS, storefront, portfolio, and dashboard.