Skip to content

Commit 01ab08b

Browse files
ryan-williamsclaude
andcommitted
gbfs/api: dynamic per-station og:image (/og/s/<slug>.png)
Satori-rendered 1200×630 share cards: station header (name, short_name, docks, type, since) + a live 7-day hourly bikes sparkline read through the full avail-v3 serving path (synthesized internal request → inventory planner → LUC cell query — one code path to trust). ~1.5 s cold, edge-cached 1d, ~35 KB PNG. Workers-wasm wrinkles, for posterity: - default `satori` entry embeds yoga wasm as base64 and compiles at runtime → "Wasm code generation disallowed by embedder". Use `satori/standalone` + `init(yogaModule)` with wrangler-compiled `.wasm` imports (same for resvg via `initWasm`). - `src/assets/yoga.wasm` is copied from satori's own `./yoga.wasm` export (version-matched to its yoga-layout dep) — recopy on bumps. - defining any `[[rules]]` (needed for the `.ttf` Data rule) displaces wrangler's built-in CompiledWasm rule; both restated. - satori needs `nodejs_compat` (`process` references). Sparkline degrades gracefully: no LUC entry / no data → header-only card. Phase 2 (task #153): www build step emitting per-station HTML stubs whose `og:image` meta points here (crawlers don't run JS; GH Pages serves one index.html for all routes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d3e2596 commit 01ab08b

9 files changed

Lines changed: 421 additions & 1 deletion

File tree

gbfs/api/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
"dependencies": {
1818
"@rdub/file-tree": "https://github.com/runsascoded/file-tree#d3476b0d2cb398197f3a1383f41fe3b0216be39f",
1919
"@rdub/thrds": "https://github.com/runsascoded/thrds#ts-dist",
20+
"@resvg/resvg-wasm": "^2.6.2",
2021
"hyparquet": "https://github.com/runsascoded/hyparquet#0f355ea5a37dcb9b29a43e33a3d45ce660c80798",
2122
"pyrmts": "https://github.com/runsascoded/pyrmts#ffc72db1c72dca93db719b1fe6e250c31e5644e9&path:/js/packages/pyrmts",
2223
"pyrmts-cfw": "https://github.com/runsascoded/pyrmts#ffc72db1c72dca93db719b1fe6e250c31e5644e9&path:/js/packages/pyrmts-cfw",
23-
"pyrmts-geo": "https://github.com/runsascoded/pyrmts#ffc72db1c72dca93db719b1fe6e250c31e5644e9&path:/js/packages/pyrmts-geo"
24+
"pyrmts-geo": "https://github.com/runsascoded/pyrmts#ffc72db1c72dca93db719b1fe6e250c31e5644e9&path:/js/packages/pyrmts-geo",
25+
"satori": "^0.26.0"
2426
}
2527
}

0 commit comments

Comments
 (0)