From 0dae8b0daa3d5cb695486c2961fa1c20687c438c Mon Sep 17 00:00:00 2001 From: hoelee Date: Tue, 20 Oct 2026 23:37:52 +0800 Subject: [PATCH] fix(art): give both 2026-10-20 posts their artwork, and gate the build on it The YuE2 and subtitles posts shipped text-only: render_from_art.mjs only READS ogImage/banner, and after the 2026-10-19 bulk migration no script had to write them, so both pages advertised /og-default.jpg and rendered no hero banner. - new metaphors (in build_captions.py, frozen here via sync_prompts_catalog.py), captions, art-meta evidence, banner plan and the five derived files per slug - frontmatter: ogImage + banner in EN and ZH for both posts - scripts/check-assets.mjs is now step 1 of npm run build, so CI fails when a published post lacks a language-correct og card, banner, banner .webp or 400/800 list thumb. It reported 16 problems on the unfixed tree, all here. --- docs/design-guide.md | 6 + docs/project-state.md | 7 + package.json | 2 +- ...subtitles-for-songs-without-timestamps.jpg | Bin 0 -> 64643 bytes ...ubtitles-for-songs-without-timestamps.webp | Bin 0 -> 48660 bytes ...12gb-gpu-songs-that-lost-their-endings.jpg | Bin 0 -> 58964 bytes ...2gb-gpu-songs-that-lost-their-endings.webp | Bin 0 -> 41576 bytes ...subtitles-for-songs-without-timestamps.jpg | Bin 0 -> 71990 bytes ...tles-for-songs-without-timestamps-400.webp | Bin 0 -> 6498 bytes ...tles-for-songs-without-timestamps-800.webp | Bin 0 -> 18648 bytes ...gpu-songs-that-lost-their-endings-400.webp | Bin 0 -> 4864 bytes ...gpu-songs-that-lost-their-endings-800.webp | Bin 0 -> 15000 bytes ...12gb-gpu-songs-that-lost-their-endings.jpg | Bin 0 -> 72623 bytes ...subtitles-for-songs-without-timestamps.jpg | Bin 0 -> 72283 bytes ...12gb-gpu-songs-that-lost-their-endings.jpg | Bin 0 -> 72716 bytes scripts/check-assets.mjs | 134 ++++++++++++++++++ scripts/og-gen/art-meta.json | 6 + scripts/og-gen/banner-plan.json | 48 +++++++ ...ubtitles-for-songs-without-timestamps.json | 1 + ...2gb-gpu-songs-that-lost-their-endings.json | 1 + scripts/og-gen/metaphors.json | 4 +- scripts/og-gen/prompts_catalog.json | 14 ++ ...-subtitles-for-songs-without-timestamps.md | 2 + ...-12gb-gpu-songs-that-lost-their-endings.md | 2 + ...-subtitles-for-songs-without-timestamps.md | 2 + ...-12gb-gpu-songs-that-lost-their-endings.md | 2 + 26 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 public/banners/generating-subtitles-for-songs-without-timestamps.jpg create mode 100644 public/banners/generating-subtitles-for-songs-without-timestamps.webp create mode 100644 public/banners/yue2-on-a-12gb-gpu-songs-that-lost-their-endings.jpg create mode 100644 public/banners/yue2-on-a-12gb-gpu-songs-that-lost-their-endings.webp create mode 100644 public/og/generating-subtitles-for-songs-without-timestamps.jpg create mode 100644 public/og/thumb/generating-subtitles-for-songs-without-timestamps-400.webp create mode 100644 public/og/thumb/generating-subtitles-for-songs-without-timestamps-800.webp create mode 100644 public/og/thumb/yue2-on-a-12gb-gpu-songs-that-lost-their-endings-400.webp create mode 100644 public/og/thumb/yue2-on-a-12gb-gpu-songs-that-lost-their-endings-800.webp create mode 100644 public/og/yue2-on-a-12gb-gpu-songs-that-lost-their-endings.jpg create mode 100644 public/og/zh-generating-subtitles-for-songs-without-timestamps.jpg create mode 100644 public/og/zh-yue2-on-a-12gb-gpu-songs-that-lost-their-endings.jpg create mode 100644 scripts/check-assets.mjs create mode 100644 scripts/og-gen/captions/generating-subtitles-for-songs-without-timestamps.json create mode 100644 scripts/og-gen/captions/yue2-on-a-12gb-gpu-songs-that-lost-their-endings.json diff --git a/docs/design-guide.md b/docs/design-guide.md index b8abb7f..59b37cf 100644 --- a/docs/design-guide.md +++ b/docs/design-guide.md @@ -43,6 +43,12 @@ Read this **before** touching theme, layout, typography, color, or SEO markup. P | Real photos (author, hardware) | **WebP q82** + JPEG fallback | Continuous-tone images are the opposite case from the flat art above. | Regenerate all derivatives after adding a post: `uv run --with pillow python scripts/optimize-images.py`. + +- **Every published post must point at its own art.** `scripts/check-assets.mjs` runs as the first + step of `npm run build` (so CI fails, not just warns) and rejects a post whose `ogImage` or + `banner` is missing or misnamed, or whose banner `.webp` / `-400` / `-800` thumbs are absent. + The renderers only *read* frontmatter — nothing writes these two fields for a new post, which is + how two 2026-10-20 posts shipped on `/og-default.jpg` with no hero banner. - **Declare `og:image:width/height` explicitly** — mis-declared dimensions get preview cards rejected by WhatsApp/Telegram/LinkedIn. - **Favicon**: reference all sizes (`.ico` + 32×32 + 192×192 PNG + apple-touch 180×180). "Favicon not showing" is usually browser cache, not a missing asset — `curl` the live files before "fixing". diff --git a/docs/project-state.md b/docs/project-state.md index 59d649b..7ea70f5 100644 --- a/docs/project-state.md +++ b/docs/project-state.md @@ -258,8 +258,15 @@ No topics were killed by the user in this sweep. - Verified with headless Chrome by injecting the built `