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 version is built with Next.js 16 (App Router), React 19, TypeScript and Tailwind CSS v4, and exports as a fully static site. 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.
Quick start#
You need Node 24 and pnpm (corepack enable pnpm), or npm.
pnpm install
pnpm devThen visit http://localhost:3000. pnpm build writes the static site to out/, and pnpm start serves it.
Pages#
| Route | File | Purpose | Notable sections and features |
|---|---|---|---|
/ |
src/app/page.tsx |
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 |
/recipes |
src/app/recipes/page.tsx |
Recipe index | Search, course, diet, total time and season filters with counts, 18 recipe cards with save hearts |
/gumbo |
src/app/gumbo/page.tsx |
Recipe story | Chicken and andouille gumbo: the story, three roux colors, step drawings, the recipe card, four comments and a comment form |
/fig-cake |
src/app/fig-cake/page.tsx |
Recipe story | Mawmaw Roseline's fig preserve cake: the story, step drawings, the recipe card, four comments and a comment form |
/recipe |
src/app/recipe/page.tsx |
Any recipe | /recipe?r=<id> shows the card for any recipe in src/data/saltbox.ts; red beans when there is no valid id |
/plan |
src/app/plan/page.tsx |
Meal plan | Today and the next six days, servings per day, and the combined shopping list |
/saved |
src/app/saved/page.tsx |
Saved recipes | The recipes saved with a heart, with "Add to meal plan" and "Remove", and in-season suggestions |
/about |
src/app/about/page.tsx |
About | Odelia, the kitchen (drawn), how a recipe gets written, the guest cooks and a FAQ |
/classes |
src/app/classes/page.tsx |
Cooking classes | The next six classes, a booking form, a FAQ and the Sunday letter signup (#letter) |
| 404 | src/app/not-found.tsx |
Not found | A recipe search and links back |
Project structure#
saltbox/
src/app/ one folder per route, plus layout.tsx and not-found.tsx
src/app/layout.tsx the page frame: skip link, live region, header, footer, metadata defaults
src/app/globals.css Tailwind: color tokens, fonts, the component layer and print styles
src/app/fonts.ts the three fonts, loaded with next/font/local
src/app/icon.svg the favicon (the salt box mark)
src/components/ header, footer and every interactive feature
RecipeCard.tsx the recipe card: servings, units, checklists, timers, nutrition, print and cook mode
RecipePage.tsx /recipe?r=<id>
RecipeIndex.tsx filters, search and the recipe grid on /recipes
RecipeTile.tsx the recipe card used in every list, with its save heart
SaveButtons.tsx the heart and "Save recipe" buttons
SavedPage.tsx the saved list and its total
MealPlan.tsx the week, the servings and the shopping list
Home.tsx dinner picker, in season now, greeting and the next class
Classes.tsx class list and booking form
Letter.tsx the Sunday letter form
CommentForm.tsx the comment form on the story pages
live.tsx date strip, season line, next letter date and year, worked out in the browser
art.tsx draws the dishes, produce and portraits
src/data/saltbox.ts all content the features read (RECIPES, ITEMS, PEOPLE, SEASONAL, CLASS_TOPICS...)
src/lib/ the logic: amounts and rounding, recipes and filters, plan and list, time and holidays,
storage, forms, and the drawings (art.ts)
src/fonts/ the font files and their licenses
public/img/ favicon.svg, og-image.svg, og-image.png
next.config.ts static export and DEMO_BASE_PATH
package.json scripts, dependencies and browser targets
README.md short introduction
DOCS.md this guide
CHANGELOG.md the template's own changelog
LICENSE.txt added to the downloadCustomizing#
Brand and colors#
Colors are tokens in the @theme block of src/app/globals.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:
--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 (Logo in
src/components/icons.tsx), icon.svg, og-image.svg, the offset shadows (#26211c) and the drawings in
src/lib/art.ts use hex colors directly; change them too if you rebrand. The browser theme color is
viewport.themeColor in src/app/layout.tsx.
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 (400, 500, 700 and italic 400), and
the handwritten kickers and labels use Nothing You Could Do. They are self-hosted with next/font/local in
src/app/fonts.ts, from the .woff2 files in src/fonts/ (the same Latin files Google Fonts serves the HTML
version), so the site makes no requests to Google. Each face keeps its plain family name, so the CSS can name it
directly:
const display = localFont({
src: "../fonts/YesevaOne-latin.woff2",
weight: "400",
display: "swap",
fallback: ["Yeseva One"],
adjustFontFallback: false,
declarations: [{ prop: "font-family", value: "Yeseva One" } /* , unicode-range */],
});The families are set as --font-display, --font-sans and --font-hand in src/app/globals.css. To swap a font,
put its files in src/fonts/, change the matching localFont() call (paths, weights and the family name in
fallback and declarations) and the variable.
Content#
Page text is in the route files under src/app/. Everything interactive reads from src/data/saltbox.ts:
| Constant | What it holds |
|---|---|
SITE |
Name, timeZone (America/Chicago), town, email addresses and phone |
PEOPLE |
The cook and the guest cooks: name, role, town and portrait settings (skin, hair, hairStyle, shirt, glasses) |
COURSES, DIETS |
Course and diet filters (main, stew, side, bread, dessert, preserve; vegetarian, gluten-free, dairy-free) |
TIMES |
Total-time buckets: quick (30 minutes or less), hour (31 to 60), long (more than an hour) |
SEASONS |
Winter (December to February), spring, summer and fall, by month |
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) |
COUNT_UNITS |
Counted units and their plurals: clove, stalk, can, slice, ear, bunch, head |
RECIPES |
The 18 recipes, newest first (see below) |
PRODUCE, SEASONAL, MONTH_NOTES |
The drawn produce, the Louisiana produce calendar (six items per month) and a line per month |
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 |
CLOSED_EVERY_YEAR, CLOSED_DAYS |
No classes on '12-24' and '12-31' every year, plus any 'YYYY-MM-DD' dates you add |
LETTER_WEEKDAY |
The day the Sunday letter goes out (0, Sunday) |
A recipe looks like this (shortened):
{
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:uis'tsp','tbsp','cup','oz','lb', a counted unit fromCOUNT_UNITS, or''for things counted on their own (eggs, onions).q: nullmeans "as needed" and never scales.whole: truerounds a count to whole numbers. kis theITEMSkey that the shopping list merges on. Leave it out for things you don't buy (a pan coating).{ h: 'For the glaze' }iningredientsstarts 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. monthslists when it is in season (all 12 means all year, never "in season now").postis the full story page ("/gumbo"); withnull, cards link to/recipe?r=<id>.artis a dish drawing fromDISHESinsrc/lib/art.ts.nutritionis per serving (grams; sodium in milligrams).scaleNoteis 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 "Browse all 18 recipes" button on the home page is written into src/app/page.tsx; update it by hand.
Images and artwork#
All artwork is inline SVG drawn for this template. The dish drawings (DISHES), produce (PRODUCE_SHAPES) and
portraits (portraitArt, from the settings in PEOPLE) are in src/lib/art.ts and are drawn by DishSvg,
ProduceSvg and PortraitSvg in src/components/art.tsx. The step drawings on the two story pages, the kitchen
scene on /about and the 404 drawing are inline in the route files. 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. Use
asset() from src/lib/asset.ts for any file in public/, so it follows the base path.
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 src/app/icon.svg (a copy is in public/img/favicon.svg).
Navigation, header and footer#
The menu links are the NAV array at the top of src/components/SiteHeader.tsx; the same component marks the
current page with aria-current="page" (the story pages and /recipe count as Recipes). The footer is
src/components/SiteFooter.tsx. To add a page, create src/app/<route>/page.tsx, export metadata from
pageMetadata() and add the link to NAV and the footer.
The teal strip above the header shows today's date and what is in season (TodayText and SeasonShortText in
src/components/live.tsx). The heart link in the header goes to /saved and shows the saved count
(data-saved-count). The site is light only.
Features#
Recipe card#
Each recipe page has one card, RecipeCard in src/components/RecipeCard.tsx, with the amounts and rounding in
src/lib/quantities.ts. 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 src/components/RecipeCard.tsx. 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" (src/components/SaveButtons.tsx, with the store in src/lib/stores.ts). 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 (src/components/RecipeIndex.tsx, with the rules in src/lib/recipes.ts) 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. Clicking
"Recipes" in the menu, or a link to another filter, starts the page over from that address.
Dinner picker#
The home page's "What's for dinner tonight?" (DinnerPicker in src/components/Home.tsx) 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 (InSeason in src/components/Home.tsx) 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 (src/components/MealPlan.tsx, with the plan and list rules in src/lib/plan.ts) 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 (src/components/Classes.tsx, with the dates in classDates() in src/lib/recipes.ts) 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 above
classDates(). "Save me a seat" on a class picks it in the form. The home page shows the next class (NextClass in
src/components/Home.tsx).
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.
Menu, header and motion#
The menu button toggles the mobile menu (aria-expanded; Escape closes it). Sections with reveal fade in once
as they scroll into view (src/components/RevealController.tsx); 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,
with the helpers in src/lib/time.ts):
| Content | Rule | Where |
|---|---|---|
| Date strip and greeting ("Happy Sunday!") | Today | TodayText, WeekdayText |
| 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 | YearText in src/components/live.tsx |
Federal holidays are worked out for any year by rule (federalHolidays() in src/lib/time.ts): 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/lib/time.ts.
These parts are worked out in the browser after the page loads, so the static HTML never goes stale: before that, the date strip, greeting, letter date and year show the text written in the page, and the class list, in-season panel and meal plan appear once the date is known.
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. All three use useFormChecks() from
src/lib/use-form.ts, which takes the form, a check per field name and an onSuccess callback.
| Form | Where | Checks | Success |
|---|---|---|---|
Class booking ([data-class-form]) |
src/components/Classes.tsx |
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]) |
src/components/Letter.tsx (home and /classes) |
First name, email format | "Thanks, {first name}. You're on the list." with the next letter's date |
Comment ([data-comment-form]) |
src/components/CommentForm.tsx (the story pages) |
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.
Connect a form#
Send the data in the onSuccess callback you pass to useFormChecks() (the last argument in each of the three
components), and show the success panel only when the service answers OK. With Formspree:
async (f) => {
const response = await fetch("https://formspree.io/f/your-id", {
method: "POST",
headers: { Accept: "application/json" },
body: new FormData(f),
});
if (!response.ok) return; // show an error and keep the form
// then show the success panel, as the callback does now
};The chosen class is sent as classDate (YYYY-MM-DD); the topic and time follow from the date.
If you remove static export (see Building and deploying), you can post to a Route Handler
instead, in src/app/api/classes/route.ts:
export async function POST(request: Request) {
const form = await request.formData();
// validate, send the email or store the booking, then answer
return Response.json({ ok: true, classDate: form.get("classDate") });
}Saved data (localStorage)#
All storage goes through safeStorage in src/lib/safe-storage.ts, which falls back to memory when the browser
blocks localStorage, so the page keeps working for the visit. Keys are in STORAGE_KEYS.
| 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 /saved, "Clear
the week" and "Uncheck all" on /plan clear the data; you can also remove the keys in the browser's developer
tools (Application → Local Storage).
["saltbox:saved", "saltbox:plan", "saltbox:list", "saltbox:units"].forEach((key) => localStorage.removeItem(key));SEO and sharing#
Each page exports metadata from pageMetadata(title, description) in src/lib/metadata.ts, which sets the title,
description and Open Graph tags and keeps the social image; the story pages pass type: "article". /recipe
updates its title and description in the browser for the recipe in ?r=. Set NEXT_PUBLIC_SITE_URL to your domain
when you build, so metadataBase in src/app/layout.tsx makes og:image an absolute URL (it defaults to
https://saltbox.example). Add src/app/sitemap.ts and src/app/robots.ts 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 andaria-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, throughannounce()insrc/lib/announce.ts). - 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. - After you follow a link, focus is not left on it, as after a full page load (
NavigationFocus.tsx). - Keep one
h1per page and label new inputs.
Building and deploying#
pnpm typecheck
pnpm lint
pnpm build # static site in out/
pnpm start # serves out/next.config.ts sets output: "export", so out/ can go on any static host, such as Netlify Drop, GitHub Pages or
Cloudflare Pages. On Vercel, import the repository and it deploys as is. To serve the site from a sub-folder, set
DEMO_BASE_PATH=/your/folder when you build. Internal links and asset() paths follow it. If you need server
features such as Route Handlers, remove output: "export" from next.config.ts and deploy to a host that runs
Next.js.
Tailwind scans the template folder (globals.css leaves out *.md, *.json and demo/), so classes in components
and in src/data/saltbox.ts are picked up. Write class names out in full; Tailwind can't see one built from a
template expression such as `bg-${color}`.
Browser targets#
The browserslist field in package.json lists the oldest browsers the build supports (Chrome and Edge 111,
Firefox 113, Safari 16.4). All of them support oklch() colors, so the Tailwind palette ships as written instead of
being converted to lab(). Add older browsers there if you need them; the build then adds color fallbacks.
Troubleshooting#
- A new class has no effect: write the whole class name in a file under
src/, not built from pieces. - 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: some browsers block the clipboard outside HTTPS or
localhost. - A class day is missing: it is a federal holiday (or its observed day), Christmas Eve, New Year's Eve or in
CLOSED_DAYS. - Dates look a day off: dates are computed in Central time. Change
SITE.timeZoneinsrc/data/saltbox.tsfor another home zone. - The date strip shows the written text for a moment: it is worked out in the browser after the page loads, so the static HTML can't go stale. This is expected.
- 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.
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 included under the SIL Open Font License (see src/fonts/).
Saltbox, its cooks, readers and businesses are fictional.