@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 29 lines 1005 Bytes
Raw
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 */
6 import { writeFile } from "node:fs/promises";
7 import { render } from "takumi-js";
8 import { brandFonts } from "../src/brand/fonts.ts";
9 import { OgCard } from "../src/brand/OgCard.tsx";
10
11 const 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
19 const png = await render(element, {
20 width: 1200,
21 height: 630,
22 format: "png",
23 fonts: brandFonts,
24 emoji: "from-font",
25 });
26
27 const out = "/tmp/og-preview.png";
28 await writeFile(out, png);
29 console.log(`wrote ${out}`);