Freeframe

Documentation

Saltbox

v1.0.0Updated Dec 6, 2026A warm recipe and home-cooking blog from Lafayette, Louisiana, with a recipe card that scales, a cook mode and a meal planner that writes the shopping list.

Overview#

Saltbox is a multi-page recipe and home-cooking blog. The fictional cook, Odelia Theriot, writes from her home kitchen in Lafayette, Louisiana, and three guest cooks from around Acadiana add their family recipes: everyday Southern and Gulf Coast cooking, weeknight suppers, baking and preserving. This is the Astro version: Astro 7 with TypeScript and Tailwind CSS v4, no UI framework, and a static build that runs on any host. It matches the HTML version page for page. Everything dated is worked out in Central time. This guide covers version 1.0.0. The template page, with a link to the live demo, is at freeframe.dev/templates/saltbox.

The look is a warm kitchen table: rice-paper pages, gingham tablecloths, index-card recipe panels with cast-iron black outlines and offset shadows, Gulf teal and cayenne accents, and hand-lettered labels. There are no photos: every dish, ingredient, step, portrait and the kitchen are drawn in inline SVG. Headings are set in Yeseva One, body text in Alegreya Sans and the handwritten labels in Nothing You Could Do. The site is light only.

Quick start#

Requirements: Node.js 24 or newer and pnpm (npm works too).

sh
pnpm install
pnpm dev          # http://localhost:4321

With npm: npm install, then npm run dev.

Command What it does
pnpm dev Development server at http://localhost:4321 with hot reload
pnpm build Static site in dist/
pnpm preview Serve dist/ locally after a build
pnpm check astro check: type-checks .astro files and TypeScript
pnpm typecheck Generate Astro's types, then type-check with tsc (TypeScript 7)
pnpm lint ESLint (TypeScript and Astro rules)
pnpm build:demo Build for /demos/astro/saltbox into demo/ (only used for the demo on freeframe.dev)

Google Fonts load from the internet, so the fonts need a connection.

Pages#

File Route Purpose and notable features
src/pages/index.astro / Home: newest recipe, dinner picker, in season this month with three recipes, the six latest recipes, where to start, about the cook, the next cooking class and a newsletter form
src/pages/recipes.astro /recipes Recipe index: search, course, diet, total time and season filters with counts, 18 recipe cards with save hearts
src/pages/gumbo.astro /gumbo Recipe story: chicken and andouille gumbo, three roux colors, step drawings, the recipe card, four comments and a comment form
src/pages/fig-cake.astro /fig-cake Recipe story: Mawmaw Roseline's fig preserve cake, step drawings, the recipe card, four comments and a comment form
src/pages/recipe.astro /recipe Any recipe: /recipe?r=<id> shows the card for any recipe in src/data/recipes.ts; red beans when there is no valid id
src/pages/plan.astro /plan Meal plan: today and the next six days, servings per day, and the combined shopping list
src/pages/saved.astro /saved Saved recipes: the recipes saved with a heart, with "Add to meal plan" and "Remove", and in-season suggestions
src/pages/about.astro /about Odelia, the kitchen (drawn), how a recipe gets written, the guest cooks and a FAQ
src/pages/classes.astro /classes Cooking classes: the next six classes, a booking form, a FAQ and the Sunday letter signup (#letter)
src/pages/404.astro 404.html A recipe search and links back

Project structure#

saltbox/
  astro.config.mjs        site URL, base path, file-style output, Tailwind plugin
  package.json            scripts and dependencies
  tsconfig.json           Astro's strict TypeScript preset
  eslint.config.mjs       ESLint flat config (typescript-eslint, eslint-plugin-astro)
  public/img/             favicon.svg (the salt box mark), og-image.svg (source) and og-image.png (social image)
  src/
    pages/*.astro         one file per page (see Pages)
    layouts/Layout.astro  <html>, <head> metadata, header, <main>, footer, live region, script import
    components/
      SiteHeader.astro    date and season strip, logo, main menu, saved count, mobile menu
      SiteFooter.astro    footer columns, contact details, copyright year
      Logo.astro          the salt box mark
      ArrowIcon.astro     the arrow on call-to-action buttons
      CookMode.astro      the cook mode dialog (on the three recipe pages)
    data/                 content and settings, typed (see Content)
    lib/site.ts           site name, theme color and the url() helper
    scripts/main.ts       every interaction, in 17 numbered sections
    styles/global.css     Tailwind source: color tokens, fonts, component layer, print styles
  README.md               short introduction
  DOCS.md                 this guide
  CHANGELOG.md            version history

Customizing#

Brand and colors#

Colors are tokens in the @theme block at the top of src/styles/global.css, so each one is also a Tailwind class (bg-linen, text-cayenne, border-rule):

Token Value Used for
--color-rice / --color-linen #f8f3ea / #efe5d4 Page background / alternate sections and control bars
--color-card #fffcf6 Recipe cards, panels and inputs
--color-ink, --color-ink-soft, --color-muted #26211c, #4a4038, #675b4f Text, outlines and offset shadows; secondary text; captions
--color-rule / --color-rule-strong #ddcfb8 / #8f806b Hairlines / input borders
--color-teal / -deep / -soft #17595a / #0f4243 / #d8e9e5 Links, primary buttons, the date strip, gingham
--color-cayenne / -deep / -soft #b23d1d / #8e2f15 / #f7dccf Hand-lettered labels, hearts, the main call to action, warnings
--color-butter / -soft #f1c24b / #fbefc6 Highlights, date tags, the shopping-list header
--color-okra, --color-pecan #5c7a34, #8a5a33 Drawings only

To change the main accent, edit the cayenne tokens; the dev server picks up the change at once:

css
--color-cayenne: #7a3b8f;
--color-cayenne-deep: #5f2c70;
--color-cayenne-soft: #ecdcf1;

Button text on teal and cayenne is card (near white), so keep those colors dark. The salt box logo in src/components/Logo.astro, public/img/favicon.svg, public/img/og-image.svg, the offset shadows (#26211c) and the drawings in src/scripts/main.ts and the pages use hex colors directly; change them too if you rebrand. The browser's theme-color is site.themeColor in src/lib/site.ts.

The component classes (.btn-teal, .btn-cayenne, .btn-line, .recipe-card, .recipe-tile, .heart-btn, .gingham, .timer, .seg, .filter-btn, .field, .choice and the rest) are in the @layer components block of the same file.

Typography#

Headings use Yeseva One, body text, labels and buttons use Alegreya Sans, and the handwritten kickers and labels use Nothing You Could Do. They load from Google Fonts with one <link> in src/layouts/Layout.astro:

html
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Alegreya+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Nothing+You+Could+Do&family=Yeseva+One&display=swap" />

The families are set as --font-display, --font-sans and --font-hand in src/styles/global.css. To swap fonts, change the link and those variables.

Content#

Page text is in the .astro pages, and the menus come from src/data/nav.ts. Everything interactive reads from the typed files in src/data/:

File Constant What it holds
site.ts SITE Name, timeZone (America/Chicago), town, email addresses and phone
site.ts PEOPLE The cook and the guest cooks: name, role, town and portrait settings (skin, hair, hairStyle, shirt, glasses)
recipes.ts COURSES, DIETS Course and diet filters (main, stew, side, bread, dessert, preserve; vegetarian, gluten-free, dairy-free)
recipes.ts TIMES Total-time buckets: quick (30 minutes or less), hour (31 to 60), long (more than an hour)
recipes.ts SEASONS Winter (December to February), spring, summer and fall, by month
recipes.ts COUNT_UNITS Counted units and their plurals: clove, stalk, can, slice, ear, bunch, head
recipes.ts RECIPES The 18 recipes, newest first (see below)
shopping.ts AISLES, ITEMS Store aisles for the shopping list, and one catalog entry per thing you buy (name, plural, aisle, shop: false to leave it off)
produce.ts PRODUCE, SEASONAL, MONTH_NOTES The drawn produce, the Louisiana produce calendar (six items per month) and a line per month
classes.ts CLASS_LEAD_DAYS, CLASS_COUNT, CLASS_SLOTS, CLASS_TOPICS Cooking classes: 3 days' notice, 6 listed, Thursday and Saturday times, the six topics with price and seats
classes.ts CLOSED_EVERY_YEAR, CLOSED_DAYS No classes on "12-24" and "12-31" every year, plus any "YYYY-MM-DD" dates you add
classes.ts LETTER_WEEKDAY The day the Sunday letter goes out (0, Sunday)
nav.ts MAIN_NAV, FOOTER_NAV The header and mobile menus, and the footer columns

The types (Recipe, Ingredient, Step, ShopItem, Person...) are exported next to the data, so a typo in a course, diet or aisle is a type error in pnpm check. A recipe looks like this (shortened):

ts
{
  id: "red-beans", short: "Red beans", title: "Tante Clotilde's Monday Red Beans",
  blurb: "Red beans cooked down with smoked sausage and a ham hock until they turn creamy on their own.",
  by: "clotilde", date: "2026-02-09", course: "stew", diets: ["gluten-free", "dairy-free"],
  months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
  times: { prep: 15, cook: 180 }, serves: 8, yield: ["serving", "servings"], post: null, art: "redbeans",
  ingredients: [
    { k: "red-beans", q: 1, u: "lb", t: "dried red kidney beans, soaked overnight" },
    { k: "onion", q: 1, u: "", t: "yellow onion{s}, chopped" },
    { k: "garlic", q: 4, u: "clove", t: "garlic, minced", whole: true },
    { k: "rice", q: null, u: "", t: "Cooked long-grain white rice, for serving" },
  ],
  steps: [
    { text: "Cook the onion, bell pepper and celery in the drippings until soft, about 8 minutes.", timer: 8, label: "Cook the trinity" },
    { text: "Take out the bay leaves and serve over rice." },
  ],
  notes: ["Add the salt at the end; salty water early can keep the skins tough."],
  nutrition: { cal: 430, fat: 20, carbs: 36, protein: 26, sodium: 990 },
}

Field notes:

  • Quantities (q) are written for the recipe's own yield (serves) in US units: u is "tsp", "tbsp", "cup", "oz", "lb", a counted unit from COUNT_UNITS, or "" for things counted on their own (eggs, onions). q: null means "as needed" and never scales. whole: true rounds a count to whole numbers.
  • k is the ITEMS key that the shopping list merges on. Leave it out for things you don't buy (a pan coating).
  • { h: "For the glaze" } in ingredients starts a group with a heading.
  • Tokens in ingredient text and steps follow the US/metric switch: {t:350} (350°F / 175°C), {in:10} (10-inch / 25-cm), {len:0.5} (1/2 inch / 1 cm), {qt:7} (7-quart / 6.5-liter). In ingredient text, {s} adds an "s" and {leaf|leaves} picks a word when the amount is more than 1.
  • months lists when it is in season (all 12 means all year, never "in season now").
  • post is the full story page ("/gumbo"); with null, cards link to /recipe?r=<id>.
  • art is a dish drawing from DISHES in src/scripts/main.ts (section 5).
  • nutrition is per serving (grams; sodium in milligrams). scaleNote is shown when the servings change.

Example: add a recipe. Copy an entry in RECIPES, give it a unique id, by from PEOPLE, course from COURSES, k values from ITEMS (add new catalog entries if needed) and an existing art key. The index, filters, counts, search, dinner picker, seasonal panel, saved page and meal planner pick it up automatically. The static counts in src/pages/recipes.astro and the "Browse all 18 recipes" button in src/pages/index.astro are written into the pages so they read right before JavaScript runs; update them by hand.

Images and artwork#

All artwork is inline SVG drawn for this template. The dish drawings (DISHES), produce (PRODUCE_SHAPES) and portraits (portraitSvg, from the settings in PEOPLE) are drawn by src/scripts/main.ts; elements with data-dish="<art key>", data-produce="<id>" or data-portrait="<person id>" are filled in by initArt. The step drawings on the two story pages, the kitchen scene on the about page and the 404 drawing are inline in the pages. There are no photos. If you use photos instead, keep the aspect ratios: dish drawings are 4:3 (200×150), portraits are square and shown in a circle.

The social image is public/img/og-image.png (1200×630), rendered from og-image.svg. After editing the SVG, regenerate the PNG with any SVG renderer. The favicon is public/img/favicon.svg.

The header is src/components/SiteHeader.astro and the footer src/components/SiteFooter.astro; both read their links from src/data/nav.ts (MAIN_NAV for the desktop and mobile menus, FOOTER_NAV for the footer columns). To add a page, create src/pages/<name>.astro with <Layout title=… description=… current="<name>">, add { key: "<name>", label: "…", href: "/<name>" } to MAIN_NAV, and the header marks it with aria-current="page" when current matches its key. The three recipe pages use current="recipes", and current="saved" marks the saved link. Pages with a feature pass its hook to <main> with mainAttrs (for example mainAttrs={{ "data-plan": "" }}), and the recipe pages add <CookMode slot="after-main" />.

Write every internal link with url() from src/lib/site.ts (url("/recipes"), url("/classes?topic=roux")), so it keeps working under a base path. The teal strip above the header shows today's date (data-today) and what is in season (data-season-short). The heart link in the header goes to /saved and shows the saved count (data-saved-count). The site is light only.

Features#

Every feature lives in src/scripts/main.ts, which the layout loads on every page. Each part looks for its markup ([data-recipe-card], [data-plan], [data-class-form]...) and does nothing on pages without it.

Recipe card#

Each recipe page has one card, built by renderCard in src/scripts/main.ts (section 9) into <div data-recipe-card="<id>">. On the two story pages the card is in <section id="recipe">, and the "Jump to recipe" button near the top links to it and moves focus to the recipe title.

The card has the times (prep, cook, rest when there is one, total), the yield, and four buttons: "Save recipe", "Cook mode", "Print recipe" and "Add to meal plan" (which opens /plan?add=<id>, plus &s=<servings> when you changed the servings).

Servings. The minus and plus buttons and the number box change the servings from 1 to 48 (MAX_SERVINGS). Typing updates the card as you go; a value outside 1 to 48 shows "Enter a whole number from 1 to 48." and the card keeps the last good number. "Back to 8" (the recipe's own yield) appears when you change it. The choice is kept in the URL as ?servings=12, so a scaled recipe can be shared. A scaleNote (pan sizes for the cake) is shown when the servings differ from the recipe.

How amounts scale and round. Volumes are added up in teaspoons, weights in ounces:

Amount US display Example (gumbo for 8 → 12)
Under 1 Tbsp Teaspoons to the nearest 1/4 (1/8 at the smallest) 1 tsp salt → 1 1/2 tsp
1 Tbsp to under 1/4 cup Tablespoons, using 1/2 Tbsp when it lands on one, otherwise Tbsp + tsp 2 tsp Creole seasoning → 1 Tbsp
1/4 cup and up Cups in quarters and thirds when within 1/2 tsp, half tablespoons under 1 cup, otherwise cups + the rest 3/4 cup oil → 1 cup + 2 Tbsp
Weight Ounces under 1 lb (half ounces under 1 oz), then pounds to the nearest 1/4 2 lb chicken → 3 lb
Counts Nearest 1/2 (nearest 1/4 under 1); whole numbers for whole: true, never below 1 1 bell pepper → 1 1/2

So 3 tsp becomes 1 Tbsp, 4 tsp is "1 Tbsp + 1 tsp" and 16 Tbsp is "1 cup". Fractions are drawn with a raised numerator (1⁄2); copied text uses 1/2.

US and metric. The "Measurements" switch (US / Metric) converts every amount and every temperature, pan size and length token in the steps. The choice is remembered (saltbox:units) and also applies to the shopping list. Conversions: 1 tsp = 4.93 mL and 1 oz = 28.35 g. Rounding:

Metric amount Rounded to
Volume under 15 mL The nearest 1 mL (at least 1 mL)
Volume from 15 mL The nearest 5 mL; from 1,000 mL, liters to one decimal (2.8 L)
Weight The nearest 5 g; from 1,000 g, kilograms to one decimal (1.4 kg)
Oven temperature The nearest 5 °C (350°F → 175°C)
Pans and lengths Whole centimeters (10-inch → 25-cm), millimeters under 1 cm
Pot size Liters to the nearest 0.5 (7-quart → 6.5-liter)

Dry ingredients stay in volume (mL) in metric, as they are measured with spoons and cups in the original.

Checklists. Each ingredient and step has a checkbox that strikes it through; "Uncheck all" clears the ingredients. Checks are not saved, so a recipe starts fresh each visit.

Step timers. Steps with a timer show a clock with "Start timer". It changes to "Pause", then "Resume"; "Reset" puts it back. Several timers can run at once. When one ends the clock shows "Done", the button reads "Restart", and the polite live region says "Time is up: Brown the sausage (step 1)." Starting and pausing are announced too ("Timer started: 8 minutes for Brown the sausage."). The progress bar has no animation, so reduced motion needs nothing extra. Timers keep running while cook mode is open and closed.

Nutrition. The table shows per serving (per slice, per biscuit) and for the whole batch at the chosen servings; the batch column scales with the servings.

Print. "Print recipe" prints only the card (the story, comments and related recipes are marked data-story and hidden), without buttons, checkboxes or timers. Printing the page from the browser menu prints the story and the card without the header and footer.

Cook mode#

"Cook mode" opens a full-screen <dialog id="cook-mode"> with one large step at a time, starting at the first step not yet checked on the card. "Previous step" and "Next step" (or the left and right arrow keys) move between steps; on the last step the button reads "Finish" and closes it. Escape or "Leave cook mode" closes it and returns focus to the button that opened it. Each step change is announced ("Step 2 of 6."). The step's timer is in cook mode too, sharing its state with the card.

While cook mode is open the page asks the browser to keep the screen on with the Screen Wake Lock API, asks again when you come back to the tab, and releases it on close. The note in the dialog says what happened:

Situation Note
The screen will stay on "Your screen will stay on while cook mode is open."
The browser has no Wake Lock API "This browser can’t keep your screen on. Tap it now and then, or turn up the screen timeout while you cook."
The browser refused (battery saver, permissions) "Your screen may still turn off: the browser didn’t allow it to stay on (battery saver can do this)."

The texts are WAKE_TEXT in section 10 of src/scripts/main.ts. Wake Lock only works on HTTPS or localhost.

Saved recipes#

Every recipe card in a list has a heart button (data-save="<id>", aria-pressed), and the recipe card has "Save recipe". Saving adds the recipe to the front of saltbox:saved, updates the count in the header and is announced ("Saved Creamy Pecan Pralines. 2 saved recipes."). /saved lists them, newest saved first, with the total ("2 saved recipes"), "Add to meal plan" and "Remove" on each; when the list is empty it shows "Nothing saved yet", a "Browse recipes" link and three recipes in season now.

Recipe index#

/recipes (section 12) filters the 18 recipes by course (one at a time), diet (every chosen diet must match), total time bucket and season, and searches titles, blurbs, ingredients, courses, diets and cooks. The search ignores accents, so "etouffee" finds Crawfish Étouffée. Each filter button shows how many recipes it would leave with the other filters kept, the heading reads "18 recipes" (or "2 recipes matching “okra”"), and the season that is current shows a small "now". "Clear filters" and "Clear all filters" reset everything.

The state is kept in the URL, so filtered lists can be shared: ?course=main, ?diet=vegetarian,gluten-free, ?time=quick|hour|long, ?season=winter|spring|summer|fall, ?q=okra. Unknown values are ignored.

Dinner picker#

The home page's "What's for dinner tonight?" (section 13) picks from the mains and soups and stews. "How much time?" offers "Any amount", "30 minutes or less" and "Under an hour"; "Eating" offers "Anything", "Vegetarian", "Gluten-free" and "Dairy-free". Recipes in season this month come first, then the rest, newest first. The first idea shown depends on the day (the day number modulo the number of ideas), so it changes daily but is the same for every visitor; "Another idea" steps through the rest ("Idea 4 of 9"). When nothing matches it says so.

In season now#

The home page panel shows six items from SEASONAL for the current month in Central time, the month's line from MONTH_NOTES, and the three newest recipes in season this month (not all-year ones), with a link to the season's filtered index. The date strip names the first three items. Edit SEASONAL to change the calendar; produce keys must exist in PRODUCE.

Meal plan and shopping list#

/plan (section 14) shows today and the next six days ("Today", "Tomorrow", then weekday names). Pick a recipe for a day and its servings (1 to 48, starting at the recipe's yield); the day links to the recipe at those servings. "Fill empty days from saved" puts saved recipes that aren't planned yet on empty days, in order; "Clear the week" empties it. Days that have passed drop off on their own and new days appear.

From a recipe card or the saved page, /plan?add=<id>&s=<servings> puts the recipe on the first empty day and says so ("Added Chicken and Andouille Gumbo to Sunday, December 6."), or says it is already planned or that the week is full. The parameters are then removed from the URL.

The shopping list adds up every planned recipe's ingredients at its servings. The same ITEMS key is merged when the amounts can be added: volumes together, weights together, and counts with the same unit (onions with onions, cloves with cloves). An "as needed" item is left out when the same thing is also on the list with an amount. Items are grouped by AISLES (Produce, Meat and seafood, Dairy and refrigerated, Bread and tortillas, Baking, Pantry and cans, Spices and seasonings), sorted by name within an aisle, and show which recipes need them. The list follows the US / Metric switch.

Each item has a checkbox, saved in saltbox:list; the header reads "15 items · 14 items left to buy" (or "Everything is checked off"). "Uncheck all" clears the checks. "Copy list" copies the items not yet checked, grouped by aisle, as plain text with the week's dates, and says "Copied 14 items to your clipboard." It uses the Clipboard API with a fallback for older browsers, and says so if copying didn't work.

Cooking classes#

/classes (section 16) lists the next six classes (CLASS_COUNT): Thursdays 6:00 to 8:30 p.m. and Saturdays 10:00 a.m. to 12:30 p.m. (CLASS_SLOTS), starting at least 3 days after today (CLASS_LEAD_DAYS). Classes skip US federal holidays (both the holiday and the day it is observed), Christmas Eve and New Year's Eve (CLOSED_EVERY_YEAR) and any CLOSED_DAYS. The topic rotates by week, and seats left come from a fixed formula, so every visitor sees the same: see the comment at the top of section 16. "Save me a seat" on a class picks it in the form. The home page shows the next class (data-next-class).

Example: on Sunday, December 6, 2026 the classes are Thursday, December 10 (Étouffée and Rice, the Weeknight Way, 1 seat left), Saturday, December 12, Thursday, December 17, Saturday, December 19, Saturday, December 26 and Saturday, January 2. Christmas Eve and New Year's Eve, both Thursdays, are skipped.

/classes?class=YYYY-MM-DD picks a listed class and ?topic=roux|biscuits|etouffee|pralines|pickles|weeknight picks the next class on that topic.

Comments#

The two story pages end with the blog's own comments from fictional readers (with "Made it" tags, not star ratings) and a comment form. There are no ratings, review counts or review structured data.

The menu button toggles the mobile menu (aria-expanded; Escape closes it). Sections with reveal fade in once as they scroll into view; with reduced motion they show immediately, and scrolling to a chosen class is instant.

Keeping the demo current#

Nothing that reads as upcoming goes stale. Everything is computed from today in Central time (SITE.timeZone):

Content Rule Where
Date strip and greeting ("Happy Sunday!") Today [data-today], [data-weekday]
In season now, dinner order The current month SEASONAL, MONTH_NOTES
Meal plan week Today and the next six days PLAN_DAYS
Class dates Thursdays and Saturdays from 3 days out, skipping holidays CLASS_*, CLOSED_*
Next Sunday letter The first Sunday after today LETTER_WEEKDAY
Copyright year Today [data-year]

Federal holidays are worked out for any year by rule (federalHolidays in section 3): New Year's Day, Martin Luther King Jr. Day, Washington's Birthday, Memorial Day, Juneteenth, Independence Day, Labor Day, Columbus Day, Veterans Day, Thanksgiving and Christmas Day. A holiday on a Saturday is observed the Friday before, one on a Sunday the Monday after.

Recipe dates and comments keep their real past dates. For reviews and screenshots, ?now=YYYY-MM-DDTHH:MM (read as Central time) pretends it is another moment, for example /classes?now=2026-12-23T10:00; turn it off with ALLOW_NOW_PARAM = false at the top of src/scripts/main.ts.

Forms#

All forms validate in the browser with inline messages linked by aria-describedby, focus the first problem and then show a success panel. A message clears as soon as the field is fixed. No form sends anything until you connect it, and the success panels don't claim an email was sent.

Form Page Checks Success
Class booking (data-class-form) classes.astro A class, seats (1 to 4, and no more than are left), first and last name, email format "Thanks, {first name}. Your seat request is in.", the class, day and time, seats, the total due at the door, a reference like SB-4821 and the email
Sunday letter (data-letter-form) index.astro, classes.astro First name, email format "Thanks, {first name}. You're on the list." with the next letter's date
Comment (data-comment-form) gumbo.astro, fig-cake.astro Name, email format, a comment of at least 10 characters (up to 1,000, counted) "Thanks, {first name}. Your comment is waiting for Odelia to read it."

Phone, allergies or notes and the "Send me the Sunday letter too" box on the booking form are optional. "Save a seat in another class" and "Write another comment" bring the forms back.

Connecting a form service#

To use a form service such as Formspree, add the request inside setupForm in src/scripts/main.ts (section 15, "Form helper"), where it calls onSuccess, and show the success panel only when the service answers OK:

ts
fetch("https://formspree.io/f/your-id", { method: "POST", body: new FormData(form), headers: { Accept: "application/json" } })
  .then((r) => { if (r.ok) onSuccess(form); else showError(); });

showError is yours to write (for example, show a message next to the submit button). The chosen class is sent as classDate (YYYY-MM-DD); the topic and time follow from the date. The site is a static build, so there is no server code to add; if you would rather send the forms to your own endpoint, add an Astro adapter and an API route, or point fetch at any serverless function.

Saved data (localStorage)#

All storage goes through safeStorage in src/scripts/main.ts, which falls back to memory when the browser blocks localStorage, so the page keeps working for the visit. The key names are in KEYS (section 1).

Key Shape Validation
saltbox:saved ["gumbo", "pralines"] Must be an array; only known recipe ids are kept, once each
saltbox:plan { "2026-12-08": { "r": "gumbo", "s": 8 } } Must be an object; only dates in this week's window with a known recipe are kept; s must be a whole number from 1 to 48, otherwise the recipe's yield is used
saltbox:list { "checked": ["onion|c:each", "flour|v"] } checked must be an array of item ids (<item key>|v, |w, |n or |c:<unit>); anything else is dropped
saltbox:units "metric" Only metric is stored; anything else means US

Keys are read with own-property checks, so names like __proto__ are ignored. "Remove" on the saved page, "Clear the week" and "Uncheck all" on the meal plan clear the data; you can also remove the keys in the browser's developer tools (Application → Local Storage).

SEO and sharing#

Each page passes its title and description to <Layout> (some also a shorter ogTitle, and the two story pages ogType="article"). The layout writes the description, a canonical URL, Open Graph tags and twitter:card. /recipe updates its title and description in the browser for the recipe in ?r=. Canonical, og:url and og:image are absolute URLs built from site in astro.config.mjs, which reads SITE_URL:

sh
SITE_URL=https://www.example.com pnpm build

The 404 page passes noindex. Add a sitemap with @astrojs/sitemap and a public/robots.txt if your host doesn't create them.

There is no recipe structured data in the template. If you add Recipe JSON-LD for real recipes, don't add ratings or review counts unless they come from real reviews.

Accessibility#

  • Skip link, landmarks, one <h1> per page and aria-current="page" in the menus.
  • Visible focus outlines, AA contrast on the paper colors, and reduced motion respected.
  • Scaling, unit changes, saves, filter results, timers, cook-mode steps and plan changes are announced in a polite live region (#live-region).
  • Filter, unit, dinner and save buttons use aria-pressed; heart buttons are labeled "Save {recipe title}".
  • Cook mode is a native <dialog> with keyboard support and focus returned on close.
  • Drawings have role="img" and a description, or are hidden from screen readers when decorative.
  • Keep one h1 per page and label new inputs.

Building and deploying#

sh
pnpm build        # static site in dist/
pnpm preview      # preview dist/ locally

dist/ is plain HTML, CSS and JavaScript. Tailwind is compiled by @tailwindcss/vite during the build, so there is no separate CSS step; it scans src/ for class names, including the strings in src/scripts/main.ts, so classes must be written out in full (the Markdown and JSON files and demo/ are excluded in global.css). Pages are written as recipes.html rather than recipes/index.html (build.format: "file" in astro.config.mjs), and links point to /recipes without a trailing slash. Netlify, Cloudflare Pages and GitHub Pages serve /recipes from recipes.html automatically; Vercel does with cleanUrls (below).

  • Netlify / Cloudflare Pages: build command pnpm build, publish directory dist.
  • Vercel: import the repository; it detects Astro and static output needs no adapter. Add a vercel.json with { "cleanUrls": true } so /recipes serves recipes.html.
  • GitHub Pages: use the official Astro GitHub Action. For a project site (username.github.io/repo), build with DEMO_BASE_PATH=/repo.
  • Any static host: upload the contents of dist/. If the host doesn't map /recipes to recipes.html, change build.format to "directory" in astro.config.mjs.

To serve the site from a sub-folder, set DEMO_BASE_PATH when building, e.g. DEMO_BASE_PATH=/saltbox pnpm build. It becomes Astro's base, and every link written with url() (including the links the script writes: recipe cards, "Add to meal plan", the planned days and the next class) includes it.

demo/ (if present) is the build used for the freeframe.dev demo; you can delete it.

TypeScript 7 setup#

package.json installs two TypeScript packages on purpose. @typescript/native is TypeScript 7 and provides the tsc that pnpm typecheck runs. typescript is an alias for @typescript/typescript6, the TypeScript 6 API that astro check and typescript-eslint load. When those tools support TypeScript 7, replace both with a single typescript@7. tsconfig.json extends Astro's strict preset.

Troubleshooting#

  • A new class has no effect: Tailwind only sees whole class names in src/. Write "bg-cayenne", not `bg-${color}`.
  • Links 404 on the host: the host doesn't map /recipes to recipes.html. Use cleanUrls on Vercel, or switch build.format to "directory".
  • Amounts show in metric: the switch is remembered in saltbox:units. Click "US" on any card or the list.
  • A scaled amount looks rounded: amounts are rounded to measures you can use in a kitchen (see the tables under Recipe card); a recipe at its own servings always shows exactly what is written.
  • A planned dinner disappeared: the plan only keeps today and the next six days; past days drop off.
  • Cook mode says the screen may turn off: Wake Lock needs HTTPS (or localhost) and is refused in battery saver; open the site over HTTPS.
  • "Copy list" says copying didn't work: the Clipboard API needs HTTPS (or localhost) in most browsers, and the fallback can be blocked too; open the site over HTTPS.
  • A class day is missing: it is a federal holiday (or its observed day), Christmas Eve, New Year's Eve or in CLOSED_DAYS.
  • Saved recipes don't persist in a preview frame: some sandboxed frames block storage; the site then keeps state in memory for the visit only.
  • Dates look a day off: dates are computed in Central time. Change SITE.timeZone in src/data/site.ts for another home zone, and the "Central" wording in src/scripts/main.ts and the pages.
  • Fonts look different offline: Yeseva One, Alegreya Sans and Nothing You Could Do come from Google Fonts and need a connection.

License#

Freeframe Commercial License: use it in unlimited websites and apps for yourself and your clients; it may not be resold or redistributed as a template. The full terms, with your licensee details, are in LICENSE.txt and at https://freeframe.dev/license#commercial. Third-party components keep their own licenses. Yeseva One, Alegreya Sans and Nothing You Could Do are provided by Google Fonts under the SIL Open Font License. Saltbox, its cooks, readers and businesses are fictional.

Search documentation

Search the guides and every template's documentation