Skip to content

Site: a generated link-preview card for every docs page and blog post - #188

Merged
ndbroadbent merged 1 commit into
mainfrom
og-images
Dec 4, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
og-images

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Every docs page, blog post and page outside the docs now gets its own 1200×630 link-preview card, generated at build time from its front matter. The WeasyPrint post's og:image used to be linebreak-p23.png.

The card (frontend/scripts/og.mjs): light theme, the VisualCI mark, a section word ("Blog" or "Docs"), the title and one line under it. For posts that line is the date and author; for other pages it's the description, cut to three lines with an ellipsis. On the right is the two-page motif from public/og.png. A post with an image shows a crop from that image's top-left inside the front page. Titles shrink as they get longer, so the longest case-study title still fits.

Tooling: I picked Satori (lays the card out as SVG) with @resvg/resvg-js (turns it into a PNG).

  • Both run inside the Node prerender we already have, with no browser and no new build step: about 60 cards in a few seconds.
  • laravel-rust-og-image is pure Rust, but using it would mean a Rust binary in the frontend build, or a build-time call to the app.
  • Fonts are @fontsource/geist's static WOFF files, because Satori can't read the WOFF2 files the site serves.
  • Talira lists Satori.

Wiring:

  • The prerender writes dist/og/<path>.png. Each page's og:image and twitter:image point at its card; twitter:card was already summary_large_image.
  • A post's JSON-LD image lists the card first, then the post's own image.
  • Each Atom entry gets a media:thumbnail.
  • The landing page keeps og.png.

Checks:

  • site.mjs fails if a page is missing og:image or twitter:image, if either names a file the site doesn't have, or if any page except the landing page uses og.png.
  • blog.test.ts checks the JSON-LD and the feed.
  • visual.sh capture copies dist/og into the build. Both CI's visual job and the local upload send it as og/ snapshots, so a broken template shows up in review.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@visualci-com

visualci-com Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #615 · 58 added, 424 unchanged · approved by visualci features agent for Nathan Broadbent

Same 58 og/ link-preview cards as build 552, after a rebase onto main. Journeys unchanged.

This PR vs base: 19 changed, 10 added since #501, across 4 builds

Snapshot Before After
og/blog/index (added) –
og/blog/laravel-rust-rewrite (added) –
og/blog/laravel-rust-starter-kit (added) –
og/blog/pdfmake-case-study (added) –
og/blog/weasyprint-case-study (added) –
og/compare/applitools (added) –
og/compare/argos (added) –
og/compare/backstopjs (added) –
and 50 more in the build

docspring/visualci · journeys · build #614 · 50 unchanged · no changes

This PR vs base: 3 changed, 8 added since #489, across 4 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent force-pushed the og-images branch 2 times, most recently from 224e479 to fb59dcb Compare December 4, 2026 09:59
…awn at build time (satori + resvg-js); og:image, twitter:image, JSON-LD and the Atom feed point at it; the cards are og/ snapshots in the VisualCI build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant