Commit 01ab08b
gbfs/api: dynamic per-station og:image (
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>/og/s/<slug>.png)1 parent d3e2596 commit 01ab08b
9 files changed
Lines changed: 421 additions & 1 deletion
File tree
- gbfs/api
- src
- assets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
0 commit comments