Back to all catalogs

astro-site-template

Astro starter template for building and deploying sites to Cloudflare Pages.

Last synced:

Template metadata

Repository
matt-riley/astro-site-template
Language
Astro
Topics
astro, cloudflare-pages, tailwindcss, template, vitest
Last updated

README

mysite

An Astro site deployed to Cloudflare Pages.

Stack

Getting Started from Template

  1. Click "Use this template" on GitHub to create your repo
  2. Clone your new repo
  3. Replace placeholders:
    # Update wrangler.toml — change "mysite" to your project name
    # Update package.json — change "astro-site-template" to your project name
    # Update README.md — replace YOUR_USERNAME, write your own description
    
  4. Set up Cloudflare Pages secrets in GitHub repo settings:
    • CLOUDFLARE_API_TOKEN — API token with Pages edit permission
    • CLOUDFLARE_ACCOUNT_ID — your Cloudflare account ID
  5. Install dependencies and start developing:
    pnpm install
    pnpm dev
    

Development

pnpm dev          # Start dev server
pnpm build        # Build for production
pnpm preview      # Preview production build locally

Testing

pnpm test         # Run tests once
pnpm test:watch   # Run tests in watch mode

Linting & Formatting

pnpm lint         # Lint with oxlint
pnpm format       # Format with oxfmt
pnpm format:check # Check formatting (CI uses this)

Deployment

Deployment happens automatically on push to main via the Cloudflare Pages deploy workflow.

To deploy manually:

pnpm build
pnpm wrangler pages deploy dist --project-name=mysite

License

MIT