1/**
2 * One-shot preview generator for the blog OG card. Renders a sample
3 * card to /tmp/og-preview.png using the same Takumi pipeline
4 * as the production endpoint.
5 */
6import { writeFile } from "node:fs/promises";
7import { render } from "takumi-js";
8import { brandFonts } from "../src/brand/fonts.ts";
9import { OgCard } from "../src/brand/OgCard.tsx";
10
11const element = OgCard({
12 kind: "blog",
13 title: "What's new in beta.39",
14 description:
15 "A small, high-impact fix release — VITE_* env props are now inlined into the client bundle, the Cloudflare Worker HTTP adapter runs handlers through Effect's standard HTTP lifecycle (unblocking RpcServer.toHttpEffect), and the SendEmail binding from beta.38 is now wired into Worker binding inference.",
16 date: "2026-05-13",
17});
18
19const png = await render(element, {
20 width: 1200,
21 height: 630,
22 format: "png",
23 fonts: brandFonts,
24 emoji: "from-font",
25});
26
27const out = "/tmp/og-preview.png";
28await writeFile(out, png);
29console.log(`wrote ${out}`);