Skip to content

Generate ledger OG cards per recipe at build time - #51

Merged
joshnesbitt merged 3 commits into
mainfrom
og-cards
Aug 26, 2026
Merged

joshnesbitt merged 3 commits into
mainfrom
og-cards

Conversation

@joshnesbitt

Copy link
Copy Markdown
Owner

Replaces the stale /assets/background.jpg OG fallback with a generated 1200×630 "ledger card" per recipe (the typographic Option B design):

  • src/lib/og.ts — renders the card with satori + resvg in the Kitchen Ledger palette and fonts: entry number, title (auto-sized so long titles wrap to two lines), description, food/drink chip, ingredient count (leaf count of the recipe table) and logged date.
  • src/pages/og/[slug].png.ts — static endpoint emitting /og/<slug>.png for every post plus /og/default.png (a centred site card) for non-post pages. Runs at build time, ~75ms per card, no headless browser needed so it works on Netlify.
  • Base.astro — posts with photos still prefer the photo; everything else uses its generated card. Twitter card switched to summary_large_image.
  • Static TTF weights of Source Serif 4 and IBM Plex Mono are committed under src/og/fonts/ (satori can't use variable fonts).

🤖 Generated with Claude Code

https://claude.ai/code/session_012C87BaZq5QEpM4C6XAWbRY

joshnesbitt and others added 3 commits August 26, 2026 08:25
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@joshnesbitt
joshnesbitt merged commit a9dd34a into main Aug 26, 2026
5 checks passed
@joshnesbitt
joshnesbitt deleted the og-cards branch August 26, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant