Repository navigation
Site: a generated link-preview card for every docs page and blog post - #188
Merged
Merged
Conversation
VisualCIdocspring/visualci · build #615 · 58 added, 424 unchanged · approved by visualci features agent for Nathan Broadbent
This PR vs base: 19 changed, 10 added since #501, across 4 builds
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
force-pushed
the
og-images
branch
2 times, most recently
from
December 4, 2026 09:59
224e479 to
fb59dcb
Compare
…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
ndbroadbent
force-pushed
the
og-images
branch
from
December 4, 2026 10:07
fb59dcb to
6bfa0a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 frompublic/og.png. A post with animageshows 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).laravel-rust-og-imageis pure Rust, but using it would mean a Rust binary in the frontend build, or a build-time call to the app.@fontsource/geist's static WOFF files, because Satori can't read the WOFF2 files the site serves.Wiring:
dist/og/<path>.png. Each page'sog:imageandtwitter:imagepoint at its card;twitter:cardwas alreadysummary_large_image.imagelists the card first, then the post's own image.media:thumbnail.og.png.Checks:
site.mjsfails if a page is missingog:imageortwitter:image, if either names a file the site doesn't have, or if any page except the landing page usesog.png.blog.test.tschecks the JSON-LD and the feed.visual.sh capturecopiesdist/oginto the build. Both CI'svisualjob and the local upload send it asog/snapshots, so a broken template shows up in review.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.