๐Ÿ”ฅ All-Access Pass โ€” $199 USD (Regular $499) ยท Unlock all 2,836 Astro themes โž”
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Docs/Getting Started/Project Structure

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.json

The 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.

Unlock every theme

Get lifetime access to 2,836 themes for $199 USD (Regular $499 USD).

Get All-Access Pass ($199) โž”