Skip to content

Embed hosted diagrams: a README image that updates, an iframe and oEmbed - #91

Merged
raj-khan merged 1 commit into
mainfrom
fl-88-embeds
Sep 27, 2026
Merged

raj-khan merged 1 commit into
mainfrom
fl-88-embeds

Conversation

@raj-khan

Copy link
Copy Markdown
Owner

FL-88.

  • /d/:id.svg stays current in a README: served with Cache-Control: no-cache, max-age=0 and an ETag per revision (and format), with an explicit 304 on If-None-Match. GitHub's image proxy asks every time; an unchanged drawing costs a 304, an update shows at once.
  • /d/:id/embed: the drawing alone, fitted to the frame, linking back to the page; Content-Security-Policy: frame-ancestors *, no X-Frame-Options.
  • /oembed?url=: rich oEmbed JSON (version 1.0), an iframe sized to the drawing within maxwidth/maxheight, and the OG image as the thumbnail; 404 for links that are not ours, 501 for format=xml. The page advertises it with <link rel="alternate" type="application/json+oembed">, so Notion, Medium and docs sites embed a pasted link.
  • Share gains Copy README image ([![Title](…/d/id.svg)](…/d/id)) and Copy embed code (the iframe).
  • README: the new URLs and how embeds stay current.

Tests: server suite against PostgreSQL (16, three new), publish e2e for both buttons. e2e 144, vitest 300, lint and typecheck.

The .svg link revalidates on every view, /d/:id/embed can be framed by
any site, and /oembed lets Notion, Medium and docs sites embed a link.
Share copies the README image and the embed code.
@raj-khan
raj-khan merged commit 4c41a87 into main Sep 27, 2026
4 checks passed
@raj-khan
raj-khan deleted the fl-88-embeds branch September 27, 2026 14:35
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