ADR 0368: A visual card uses one of the author's own published images, tried in a fixed order, with its recorded credit
- Status: Accepted
- Date: 2026-10-29
- Parent epic: #383
- Story: #393 (task DIST3.1.1)
Context#
Epic #383 asks for destination-ready visual cards (a Pinterest Pin first, story #394) built from imagery the author
already has, with source attribution, and with no mandatory AI generation. A post already publishes images: its
cover (cover, with the aliases image, coverImage, hero, and coverAlt), the photographs in its body, and
the link preview image its page declares (og:image: the cover, else a video post's thumbnail, else the
site's ogImage). Recipe and field-journal (travel) posts are where the body's photographs matter most. Nothing records
who made an image.
Decision#
- Candidates, in a fixed order, each once.
openblog_core::visual_card::image_candidatesoffers the explicitcardImage(withcardImageAlt,cardImageCredit,cardImageCreditUrl), then the authored cover (withcoverAlt,coverCredit,coverCreditUrl), then, for therecipeandfield-journalprofiles only, the images in the post's portable Markdown in order, at most eight. An article never offers a body image: an inline diagram is rarely a card. A second mention of one address is dropped. Later checks (ADR 0370) choose the first candidate a destination accepts, so the order is the author's control: setcardImageto override. - Only what leaves the site. Body images come from the portable Markdown, the same text copies and feeds use, so an image in a private or held-back part of a post never becomes a card. The CLI builds a card only for a production-visible post.
- Addresses resolve the way the site serves them. A front matter image follows the build's own rule for
og:image(a path is relative to the site's address); a body image resolves against the page, as a browser does. An address inside the site's own origin and base path becomes a decoded path in the static folder, refused if it names a folder or has an empty,.or..segment after decoding; dot segments are normalised first, so one that climbs out of the site is just another address and is never read as a file. An image on another site must behttps.data:and scheme-relative addresses are refused, because a destination needs an image at an address. - Attribution is recorded, never invented. A credit is one line of at most 200 characters and an optional
httpslink; the card shows "Image:" and carries the link. A body image has no credit field, so its credit is empty; every card still links back to the canonical post, which is the source of the work. The link preview candidate ( page_image_candidate) is exactly the build'sog:imageand carries the cover's credit only when it is the cover. The renderer andopenblog cardchoose the post's own share image through one helper,Post::page_image(the cover, else the video thumbnail), so the two cannot drift. - Fixed problems. Each refusal is a fixed code (
image-address-unusable,image-not-https,credit-too-long,credit-url-invalid) with a sentence that never repeats the address, the credit or any other author text.
Considered options#
- Pick the largest or best-looking image automatically. Rejected: it needs every image's pixels and a taste judgement; a fixed order with an explicit override is deterministic and explainable.
- Generate a card image. Rejected by the epic: no mandatory generative dependency.
- A nested
card:block in front matter. Rejected: the front matter parser nests onlyjob(ADR 0285), and flat keys sit besidecoverandcoverAlt, which authors already know.
Consequences#
- No new key changes a build: the static site, feeds, exports and cross-posting read none of them.
- A recipe or travel post with a weak cover can still get a card from its own photographs.