cooking/README.md
Olomana (multica agent) b7c526a784 PWS-13: Make recipe markdown fully control the tabs
Every top-level :::name block is now a tab, shown in file order, so
authors can add custom tabs and reorder them in the markdown. Titles
come from the name or a :::name[Title] label.

The recipe card is an ordinary :::card tab. Its body lists what it
prints (::ingredients, or a block written just for the card), replacing
::card, the fallback to full sections, and its fixed tab position.

All recipes are migrated, with pages and card images unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-07 00:34:10 -08:00

121 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# cooking
A content-first personal recipe site.
**Live site:** [recipes.whitney.rip](https://recipes.whitney.rip)
## Stack
- **Next.js**, **TypeScript** + **Tailwind CSS**
- **Markdown** with YAML frontmatter metadata, using directives (`:::ingredients`) for recipe tabs.
- **remark** (+ gfm, directive) for server-side parsing; **satori** + **sharp** for printable recipe cards.
- No database — recipes are checked into the repo.
## Project Structure
```
app/
page.tsx # Homepage
recipes/
page.tsx # Recipe listing with search/filter
[category]/[slug]/
page.tsx # Recipe detail page
components/ # UI components
lib/
recipes.ts # Recipe loader (reads from recipes/)
recipes/ # All recipe content (markdown + images colocated)
[category]/
[slug]/
[slug].md
assets/
hero.jpg
public/
assets/ # Site-level data.
authors.json # Author metadata
```
## Adding a Recipe
1. Create a folder: `recipes/[category]/[recipe-slug]/`
2. Add `[recipe-slug].md` with frontmatter and content
3. Create an `assets/` subfolder and add images
4. Reference images with relative paths: `./assets/image.jpg`
### Frontmatter
```yaml
---
title: "Recipe Title"
slug: "recipe-slug"
date: "YYYY-MM-DD"
lastUpdated: "YYYY-MM-DD"
category: "mains"
tags: ["italian", "chicken"]
cookTime: 45
prepTime: 20
servings: 4
author: "PWS"
description: "Short description for SEO and previews"
featured: false
display: true
displayPhoto: "./assets/hero.jpg"
---
```
`display: false` hides a recipe without deleting it. Author IDs reference `public/authors.json`. Categories and tags are free-form strings — no taxonomy file to keep in sync.
### Content Structure
Each `:::name` block is a tab, shown in file order. Any name works, and `:::name[Title]` sets the title. `:::card` is a printable 5×7 recipe card that lists what it prints:
```md
Intro prose (rendered above the tabs).
:::photos
![Finished dish](./assets/hero.jpg "Caption text")
:::
:::ingredients
- 1 cup short grain rice
:::
:::instructions
1. Rinse and cook.
:::
:::notes
Optional tips.
:::
:::card[Recipe Card]
::ingredients
::instructions
:::
:::references
Optional credits.
:::
```
If a recipe is too long for the card, it's split front/back automatically. To write a shorter card instead, use `::::card` (four colons) containing its own `:::ingredients` and/or `:::instructions` blocks. See `.claude/rules/recipe-format.md` for the full format.
## Development
```bash
npm install
npm run dev # 3000
npm run build
npm run lint
npm test
```
## Deployment
```bash
docker compose down && docker system prune -f && docker compose up -d --build && docker logs -f recipes
```