Skip to content

site: Give every page its own Open Graph card, and serve robots.txt - #24

Merged
glani merged 2 commits into
mainfrom
site/og-cards
Nov 20, 2026
Merged

glani merged 2 commits into
mainfrom
site/og-cards

Conversation

@glani

@glani glani commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • An Open Graph card for every page, /og/<page>.png, 1200×630, made when the site is built (site/src/lib/og.ts, site/src/pages/og/[...slug].png.ts): the crate's mark and name, the page's title and description in the dark theme and IBM Plex Sans, and a strip of an example's poster along the bottom. satori lays the card out and writes its text as paths, so the build needs no fonts installed; sharp, which the site already uses, makes the PNG. The route middleware points each page's og:image at its card, with og:image:width, og:image:height and og:image:alt; the 404 page has none.
  • A page picks its poster with poster in the frontmatter (quotes by default). The three demo pages keep the posters their hand-written og:image showed; Examples takes the desk, Performance the ops example. The site-wide default from site: Add llms.txt, a link preview and a comparison of Rust data grids #23 goes; social-preview.png stays for the repository's settings.
  • /robots.txt: every page may be crawled, with pointers to /sitemap-index.xml and /llms.txt. Today Cloudflare answers that path with its content signals alone, with no directives and no sitemap; it puts them in front of this file instead.

New build dependency: satori 0.63.2 (MPL-2.0), used only to build the site.

Checks

  • bun run --cwd site build, bun run --cwd site check (0 errors), bun test --cwd site (84 pass; the new check holds every page to its card, a 1200×630 PNG)
  • docker/site/stage.sh, docker build, docker/site/smoke.sh: passed, with new checks for /robots.txt (UTF-8 text) and /og/index.png (image/png)
  • typos

Every page may be crawled; the file points to the sitemap, which no file
named until now, and to /llms.txt. Cloudflare puts its content signals in
front of it, as it does today on its own. The image's smoke check that it
goes out as UTF-8 text.
A link to any page now shows a 1200x630 card made for it when the site is
built (/og/<page>.png): the crate's mark and name, the page's title and
description in the dark theme and IBM Plex Sans, and a strip of an
example's poster along the bottom. satori lays the card out and writes its
text as paths, so the build needs no fonts installed, and sharp makes the
PNG. The route middleware points og:image at the card, with its size and
alt text; the 404 page has none.

A page picks the poster with `poster` in its frontmatter (quotes when it
names none): the demo pages keep the posters their hand-written og:image
showed, Examples takes the desk and Performance the ops example. The
site-wide social preview default goes; the picture stays for the
repository's settings.

The link checks hold every page to its card, a 1200x630 PNG, and the
image's smoke check that the cards go out as PNG.
@glani
glani merged commit 9c26390 into main Nov 20, 2026
10 checks passed
@glani
glani deleted the site/og-cards branch November 20, 2026 10:42
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