Skip to content

Add a link-preview card (og:image) rendered with Strata - #51

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/og-image
Nov 11, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/og-image

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

A shared link to this game currently unfurls with no picture: the page has no og:image. This adds a 1200x630 link-preview card, rendered headless with Strata, and the <meta> tags that name it.

The new link-preview card

  • Picture: the game's own art: new art/og.scene is the strip (the same props as art/strip.scene) at noon on day 20, 2021-01-29 at 78 N per stills.json's setting, the first day with twilight, with the station's lamps lit. It is not a location still, so it is not in stills.json and never goes into game.zip. art/render_og.py renders it with strata-golden (built from Strata v0.7.0) and lays the title and tagline over it with community-site-kit og-card's compose(), so the type matches the other cards made with that tool.
  • Tags: web/index.html gains a description plus og:type/site_name/title/description/url/image(+type, width, height, alt) and twitter:card=summary_large_image with the same title, description, image and alt text.
  • Hosting (owner decision): arcade serves only index.html, game.zip and version.txt for a tak game, so the game's own host cannot serve the PNG. The tags therefore point at https://raw.githubusercontent.com/Stephenson-Software/Overwinter/main/web/og.png (public repo, served as image/png). The alternative, an arcade change that serves /og.png out of a tak game's bundle, was not made here.
  • Re-rendering: python3 art/render_og.py --strata-golden <strata-golden> --og-card <community-site-kit>/tools/og-card (docstring has the pins).

Verification

  • python -m pytest -q on Python 3.12: 189 passed; tests/test_og_image.py + tests/test_web_build.py also pass on Python 3.8 (the CI matrix's other version). New tests/test_og_image.py (4 tests): the PNG is 1200x630 and under 512 KB; each tag appears once; image URL, size and alt text match render_og.OG; preview title/description match the page.
  • The new test was mutation-checked: changing the page's alt text made it fail.
  • The card was looked at before committing; the alt text describes what is in it.

Notes

  • Merging this deploys the game to arcade (arcade.yml runs on every push to main), so the merge is left to the owner.

drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYNeuo7EcTsfm3BxWEeYgi

art/og.scene is the strip at noon on day 20, the first twilight, with
the station's lamps lit (the same props as art/strip.scene, framed for a
1200x630 card). art/render_og.py renders it with strata-golden (Strata
v0.7.0) and sets the title over it with community-site-kit's og-card
compose step, writing web/og.png. web/index.html gains a description and
the og:/twitter: tags naming it, with alt text. arcade serves only
index.html and game.zip for a tak game, so the image is linked from
GitHub's raw host. tests/test_og_image.py checks the PNG's size and that
the tags and alt text match render_og.OG.

drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeuo7EcTsfm3BxWEeYgi
@dmccoystephenson
dmccoystephenson merged commit 7f2fe0d into main Nov 11, 2026
3 checks passed
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