feat(related): photo cards — 6 on desktop, 4 on phones, each post's own share card
Deploy / build (push) Successful in 33s
Deploy / build (push) Successful in 33s
Related posts were 4 text-only cards. They now carry the post's language-specific ogImage (/og/<slug>.jpg for EN, /og/zh-<slug>.jpg for ZH), so an English page never shows Chinese art. Grid is 3 across above 900px, 2 across below, and phones show the first 4 only; read-time is dropped under 600px so the date fits. Verified in the built HTML + headless Chrome at 1264/884/500px: 3/2/2 columns, 6/6/4 visible cards, no horizontal overflow, all six images decoded.
This commit is contained in:
1 parent
c8cb2a25f4
commit
7f2680ea92
5 files changed
+61
-15
No files matched your search
@@ -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 `<picture>` | 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/<name>-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/<name>-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/<slug>.jpg`, ZH `/og/zh-<slug>.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`.
|
||||
|
||||
Reference in new issue
Block a user