diff --git a/docs/design-guide.md b/docs/design-guide.md index f0747d3..749d533 100644 --- a/docs/design-guide.md +++ b/docs/design-guide.md @@ -22,7 +22,7 @@ Read this **before** touching theme, layout, typography, color, or SEO markup. P - **Sticky header** — name/logo + nav (Blog / Categories / About / RSS). - **Article header** — title, pub date, reading time, category + tags, author card (photo, 1–2 line bio, LinkedIn + GitHub + git.hoelee.com links). - **Author box / ProfilePage schema** on every post (see SEO below). -- **Related posts** (3 cards) — internal linking + keeps readers on-site. +- **Related posts** (6 photo cards: 3 across on desktop, 2 across ≤900px, the first 4 only on ≤600px) — internal linking + keeps readers on-site. Each card shows the post's own language-specific share card, so an EN page never shows ZH art. - **RSS link** in footer — how the technical audience follows me. - **Custom og:image per post** — 1200×630, never the reused logo. @@ -38,7 +38,8 @@ Read this **before** touching theme, layout, typography, color, or SEO markup. P |---|---|---| | `og:image` / `twitter:image` | **PNG** (1200×630) | Social scrapers (WhatsApp / LinkedIn / FB / Telegram) do not reliably render WebP share cards. Compatibility beats bytes here. | | Article banner in-page | **WebP q78** + PNG fallback via `` | 6.02 MB → 2.52 MB across 70 banners (42%); JPEG would be *larger* (q85 = 129% of PNG) because the art is flat terminal-style with sharp text edges. | - | List/related thumbnails | **WebP q72 at 400w + 800w** (`/og/thumb/-400.webp`) | Rows display at ~398px; they used to fetch the 1200×630 PNG (~45 KB). 400w is 5.8 KB, 800w is 16.1 KB. The homepage went from ~450 KB of thumbnails to ~62 KB. | + | List thumbnails | **WebP q72 at 400w + 800w** (`/og/thumb/-400.webp`) | Rows display at ~398px; they used to fetch the 1200×630 PNG (~45 KB). 400w is 5.8 KB, 800w is 16.1 KB. The homepage went from ~450 KB of thumbnails to ~62 KB. | + | Related-post cards | The post's **own share card** (`/og/.jpg`, ZH `/og/zh-.jpg`), `loading="lazy"` | The card must match the page language, and the thumb WebPs are keyed by base slug — using them would print EN art on ZH pages. 6 cards ≈ 390 KB, deferred below the fold. | | 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`. diff --git a/docs/project-state.md b/docs/project-state.md index c9d7a97..161354a 100644 --- a/docs/project-state.md +++ b/docs/project-state.md @@ -252,6 +252,14 @@ No topics were killed by the user in this sweep. - Open, and **not** engineering: the round-5 consultant questions ("no text" acceptance line, banner framing, dark art on the light theme) — see the phase log. - ⚠ Overwriting art in place keeps the same URLs, so a returning reader sees the old picture from their own cache; hard-refresh before judging a restyle batch. +### Phase G — Related-posts photo grid (2026-10-20) +- ✅ `Related Posts` / `相关文章` went from 4 text-only cards to **6 cards carrying each post's own share card**: `ogImage` per post means the EN page shows `/og/.jpg` and the ZH page `/og/zh-.jpg` — no cross-language art. Measured in the built HTML: 6 ``, all 6 files 200, ZH page resolves all 6 to `zh-` files. +- Layout: 3 across (>900px), 2 across (≤900px), and on ≤600px the same 2 columns show only the **first 4** (`.related-extra` hidden, `i >= 4` in `[...slug].astro`). Read-time span (`.related-read`) is dropped on phones so the date fits a 160px card. +- Verified with headless Chrome by injecting the built `