MODULE 03 OF 08 · 20 min

Build With Astro (or Plain HTML)

Learn the clean static-first project structure used by professional engineering teams so your site loads in milliseconds and stays easy to edit for years.

Module Outcome:

You have a clean local website project that builds into dist/ cleanly and previews in your browser.

LESSON WORKSPACE

Your module at a glance.

4 steps
Step 1 of 4

Choose the right level of simplicity

For a single-page brochure site, a single clean index.html file is completely fine — download one of our free starter templates and go live in five minutes.

Open lesson section
Example preview01
Choose the right level of simplicity
01Read the section
02Apply to your project
03Review the result

Illustration · not connected to your accounts

Step 2 of 4

Create a clean Astro website locally

Install Node.js 22.23.4 or newer, create a minimal Astro project, and commit package-lock.json so your computer and Cloudflare build with the exact same dependency versions.

Open lesson section
Example preview02
Create a clean Astro website locally
01Read the section
02Apply to your project
03Review the result

Illustration · not connected to your accounts

Step 3 of 4

The StaticLaunch folder standard

Keep every page inside a shared layout, centralize CSS design tokens in one stylesheet, and store static files (robots.txt, _headers, _redirects, favicon) inside public/.

Open lesson section
Example preview03
The StaticLaunch folder standard
01Read the section
02Apply to your project
03Review the result

Illustration · not connected to your accounts

Step 4 of 4

Confirm your learning

You have a clean local website project that builds into dist/ cleanly and previews in your browser.

Open completion checklist
Example preview04
Confirm your learning
01Review module outcome
02Check the tasks
03Mark complete

Illustration · not connected to your accounts

Choose the right level of simplicity

For a single-page brochure site, a single clean index.html file is completely fine — download one of our free starter templates and go live in five minutes.

Once you want 3 or more pages (Home, Services, About, Contact, Blog) with a shared navigation bar and footer that you only have to edit in one place, Astro is the gold standard. Astro compiles your templates into zero-JavaScript HTML at build time.

  • Plain HTML: Zero build step, instant upload, ideal for 1–2 page sites.
  • Astro: Shared layouts, reusable components, automatic route folders (/services/index.html), Markdown content, and zero unused client JS.
  • Avoid unnecessary SPA frameworks (heavy client-side React bundles) for marketing and business websites — they slow down mobile devices and hurt SEO.

Create a clean Astro website locally

Install Node.js 22.23.4 or newer, create a minimal Astro project, and commit package-lock.json so your computer and Cloudflare build with the exact same dependency versions.

Create and test a static Astro project
node -v   # Confirm v22.23.4 or newer
npm create astro@latest my-business-site -- --template minimal --no-git
cd my-business-site
npm install
npm run dev    # Preview live at http://localhost:4321
npm run build  # Outputs static HTML into dist/

The StaticLaunch folder standard

Keep every page inside a shared layout, centralize CSS design tokens in one stylesheet, and store static files (robots.txt, _headers, _redirects, favicon) inside public/.

Recommended project layout
my-business-site/
├── public/
│   ├── images/
│   ├── favicon.svg
│   ├── robots.txt
│   ├── sitemap.xml
│   ├── _headers
│   └── _redirects
├── src/
│   ├── components/    # Reusable Header, Footer, CTA, Cards
│   ├── layouts/       # BaseLayout.astro (head, SEO, nav, footer)
│   ├── pages/         # index.astro, services.astro, contact.astro, 404.astro
│   └── styles/        # global.css with reusable design tokens
├── .node-version      # Pin Node version (e.g., 22.23.4)
├── AGENTS.md          # Guardrails for AI coding tools
├── astro.config.mjs   # output: 'static', trailingSlash: 'always'
├── package.json
└── package-lock.json

MODULE 03 VERIFICATION

Before moving on

  • Decided between plain HTML (1–2 pages) or Astro (multi-page site).
  • Local project runs cleanly with npm run dev and compiles with npm run build.
  • astro.config.mjs sets site, output: 'static', and trailingSlash: 'always'.
  • package-lock.json and .node-version are committed to GitHub.