Share images: brick trays for pages without their own, and a logo default that survives square crops

Merged
LU
3d ago
+158-7

Slack and WhatsApp crop link previews to the centre square. The old default (img/forrt-share.png) set the full name beside the logo, so the preview showed half of each.

Default. img/forrt-share-logo.png stacks the tower above "FORRT" within the centre 520 px. The full name stays in og:title. The old file is kept because cached previews and scripts/rebrand/baseline/paths.txt still point at it. The AWoP app and the annotator, which hardcode the default, now use the new file.

Area fallback. A page with no image of its own now uses a card for its Doors area: the area's illustration on its tint, the area name in Newsreader and "FORRT" in the logo's serif. The card has no tower logo, because it clashed with the 3D illustrations. Alt text comes from content/home/2-areas.md. The page's first URL segment picks the area, using [[doors.share_areas]] in params.toml. In site_head.html this fallback comes after the featured image, sharing_image_resource, sharing_image and header.image, and before the site default.

How the 3,108 pages in a local build divide:

ImagePages
Education (glossary, curated resources, lesson plans …)2,884
Community (about, contributors, newsletters …)138
Page-specific (unchanged)53
Default logo (home, CoC, privacy, imprint …)16
Justice9
Research6

scripts/render_share_images.py renders all five images. It needs Pillow, fontTools with Brotli (to read the Newsreader WOFF2) and TeX Gyre Schola, the Century Schoolbook clone used in the logo. The area plates are 640 px wide and are not enlarged; their right edges are faded so shadows that run off the plate end softly.

Checked: og:image, size, type and alt on the home page, a glossary term, a curated resource, /tags/, a replication-hub subpage, /reversals/, /dei/, /about/teams/, plus /awop/, /clusters/, /impact/, a newsletter post and /ai-metascience/, which keep their own images. check_seo_html.py passes. I inspected all five images at full size and as 250 px and 80 px centre-square crops.

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes link previews so Slack and WhatsApp centre-square crops show a complete logo, and pages without their own image no longer all share the same default.

Default share image. The old image put the full name beside the logo, so previews showed half of each. The new forrt-share-logo.png stacks the tower above "FORRT" inside the centre 520 px, with the full name moving to the page title. The annotator and AWoP app now use it; the old file stays for cached previews.

Brick-tray fallback. Pages with no image of their own now get one of 48 top-down brick-tray images in the Doors brick colours, with the logo on a centre tile. A hash of the page's path picks the tray, so a page always keeps the same tray while pages shared together differ. This replaces the earlier area-card fallback. The default image's alt text is now only used with the default image, so a featured image no longer claims to be the logo; trays get their own alt text from sharing_tray_alt. scripts/render_share_images.py renders all images and needs Pillow, fontTools with Brotli and TeX Gyre Schola.