GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - huggingpixels/pertutti: Astro + Cloudflare Pages recipe site

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
public
public
 
 
src
src
 
 
.dev.vars.example
.dev.vars.example
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
astro.config.mjs
astro.config.mjs
 
 
dev.sh
dev.sh
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
wrangler.toml
wrangler.toml
 
 

Repository files navigation

Kitchen Notes — Astro + Cloudflare Pages (SSR)

A food/recipe site scaffold: Astro 5 with the @astrojs/cloudflare adapter in output: 'server' mode, content-collection-driven recipes, schema.org Recipe JSON-LD, and Wrangler wired for Cloudflare Pages deploys.

Get running in one command

./dev.sh          # installs deps if needed, then starts http://localhost:4321

Or manually:

npm install
npm run dev

Scripts

Command What it does
npm run dev Astro dev server on http://localhost:4321 (--host so phones on your LAN can hit it). Cloudflare vars/bindings are proxied in via platformProxy.
npm run build Builds to dist/ (dist/_worker.js + static assets).
npm run preview Runs the built output in the real workerd runtime: wrangler pages dev ./dist.
npm run deploy Build + wrangler pages deploy ./dist.
npm run check Type-checks .astro/.ts files.
npm run cf-typegen Regenerates binding types from wrangler.toml.

Folder structure

food-site/
├── astro.config.mjs          # SSR + Cloudflare adapter (platformProxy on)
├── wrangler.toml             # Pages config, vars, commented KV/D1/R2 bindings
├── dev.sh                    # one-command local start
├── .dev.vars.example         # local secrets template (copy to .dev.vars)
├── public/
│   ├── favicon.svg
│   ├── robots.txt
│   └── _headers              # cache + security headers served by Cloudflare
└── src/
    ├── consts.ts             # site title, nav, categories
    ├── content.config.ts     # `recipes` collection + Zod schema
    ├── content/recipes/*.md  # your recipes live here
    ├── layouts/BaseLayout.astro   # html shell, SEO/OG meta, JSON-LD slot
    ├── components/           # Header, Footer, RecipeCard
    ├── lib/recipes.ts        # query helpers + schema.org builder
    └── pages/
        ├── index.astro
        ├── about.astro
        ├── 404.astro
        ├── sitemap.xml.ts
        ├── api/subscribe.ts               # example SSR endpoint using bindings
        └── recipes/
            ├── index.astro                # /recipes
            ├── [slug].astro               # /recipes/paprikas-krumpli
            └── category/[category].astro  # /recipes/category/baking

Adding a recipe

Create src/content/recipes/my-recipe.md. The filename becomes the URL slug. Frontmatter is validated by Zod at build time, so a typo fails loudly instead of shipping.

---
title: "Roast Chicken"
description: "One bird, one tray, forty minutes."
publishDate: 2026-07-25
category: mains          # breakfast | mains | baking | sides | desserts | drinks
tags: ["sunday", "one-tray"]
prepMinutes: 10
cookMinutes: 45
servings: 4
difficulty: easy
draft: false             # drafts show in dev, hidden in production
ingredients: ["1 whole chicken", "..."]
steps: ["Heat the oven to 220°C.", "..."]
---

Markdown body renders under the method — notes, swaps, storage tips.

Deploying to Cloudflare Pages

Manual (from your machine)

npx wrangler login
npm run deploy            # first run creates the Pages project interactively

Automatic (current setup)

The repo is connected to Cloudflare's Git integration: every push to main triggers a build on Cloudflare's side and deploys to production at pertutti.pages.dev. Other branches get preview deployments. No secrets or tokens live in GitHub.

.github/workflows/ci.yml runs alongside it as a check only — install, astro check, astro build. It never deploys, so there's no double-deploy race. Its job is to fail a PR when a recipe has bad frontmatter or the build breaks, before Cloudflare ships it.

Budget notes: the Cloudflare free plan allows 500 builds/month, 1 at a time; Actions minutes are free on public repos. Add [CI Skip] to a commit message to make Cloudflare skip a build for docs-only changes.

If you ever want deploys to run from Actions instead, turn off automatic deployments in the Pages project, then add CLOUDFLARE_API_TOKEN (Account → Cloudflare Pages → Edit) and CLOUDFLARE_ACCOUNT_ID as repo secrets and restore a deploy step using cloudflare/wrangler-action@v3.

Secrets: npx wrangler pages secret put NEWSLETTER_API_KEY. Bindings (KV/D1/R2): uncomment the blocks in wrangler.toml, create the resource with Wrangler, then read them in any page or endpoint via Astro.locals.runtime.env.<BINDING>.

Notes

  • Every route is server-rendered by default. To prerender a page at build time, add export const prerender = true; in its frontmatter — good candidates are /about and /404.
  • recipeJsonLd() in src/lib/recipes.ts emits schema.org Recipe markup, which is what gets recipe cards and cook-time chips into Google results.
  • Update site in astro.config.mjs to your real domain so canonical URLs and the sitemap are correct.

Dutch titles & kitchen words

Two optional frontmatter fields power the language side of the site:

titleNl: "Hongaarse paprika-aardappelen"   # shown under the title, in blue script
glossary:
  - nl: "sudderen"
    en: "to simmer"
    say: "SUH-deh-ren"                      # optional phonetic hint
    note: "Laat het twintig minuten sudderen." # optional usage note

glossary renders as a panel under the ingredients on the recipe page, and every term is collected automatically into /glossary (Woordenboek), merged by word, sorted with Dutch collation, and linked back to the recipes it came from. Both fields are optional — recipes without them look exactly as before. Glossary words are also added to the recipe's JSON-LD keywords, and titleNl becomes its alternateName.

About

Astro + Cloudflare Pages recipe site

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.