Astro
Build static output with a reusable layout and a pinned supported runtime.
View architectureIllustration · not connected to your accounts
OPEN REFERENCE STANDARD
Copy our exact production conventions for Astro, GitHub, and Cloudflare Pages. No proprietary lock-in, no hidden build tooling, and downloadable starter config files you can drop into any repo today.
REFERENCE ARCHITECTURE
Build static output with a reusable layout and a pinned supported runtime.
View architectureIllustration · not connected to your accounts
Keep source, rules and dependency locks together in a repository you own.
View repository structureIllustration · not connected to your accounts
Use hosting security headers and redirects while preserving your domain and mail records.
View security configurationIllustration · not connected to your accounts
Download the starter configuration files and adapt them to your specific project.
Review config downloadsIllustration · not connected to your accounts
ARCHITECTURE DIAGRAM · SEPARATION OF CONCERNS
| Layer | Standard Choice | Why |
|---|---|---|
| Framework | Astro (output: 'static') | Pre-compiles clean HTML with zero mandatory client JS runtime. |
| Interactivity | Vanilla JS (progressive enhancement) | Fast load times and zero framework churn over a 5–10 year lifespan. |
| Source Control | GitHub (production branch main) | Full history, pull-request previews, instant revert, and total portability. |
| Edge Hosting | Cloudflare Pages / Workers Static Assets | Global CDN, automatic HTTPS, native _headers & _redirects, $0 free tier. |
| Forms & Bot Defense | Cloudflare Turnstile + Worker/Form endpoint | Zero WordPress database or plugin attack surface. |
| Accessibility | WCAG 2.2 AA Target | Semantic landmarks, >= 4.5:1 contrast, visible keyboard focus, labeled inputs. |
my-business-website/ ├── public/ │ ├── images/ │ ├── favicon.svg │ ├── robots.txt │ ├── sitemap.xml │ ├── _headers │ └── _redirects ├── src/ │ ├── components/ │ ├── layouts/ │ ├── pages/ │ ├── data/ │ └── styles/ ├── .github/workflows/validate.yml ├── .gitignore ├── .node-version ├── AGENTS.md ├── astro.config.mjs ├── package.json ├── package-lock.json └── README.md
astro.config.mjsimport { defineConfig } from 'astro/config';
export default defineConfig({
site: 'https://yourbusiness.com',
output: 'static',
trailingSlash: 'always',
});public/_headers)/* X-Content-Type-Options: nosniff Referrer-Policy: strict-origin-when-cross-origin X-Frame-Options: DENY Permissions-Policy: camera=(), microphone=(), geolocation=() Strict-Transport-Security: max-age=31536000; includeSubDomains