Repository navigation
Add a link-preview card (og:image) rendered with Strata - #51
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.art/og.sceneis the strip (the same props asart/strip.scene) at noon on day 20, 2021-01-29 at 78 N perstills.json's setting, the first day with twilight, with the station's lamps lit. It is not a location still, so it is not instills.jsonand never goes intogame.zip.art/render_og.pyrenders it withstrata-golden(built from Strata v0.7.0) and lays the title and tagline over it with community-site-kit og-card'scompose(), so the type matches the other cards made with that tool.web/index.htmlgains adescriptionplusog:type/site_name/title/description/url/image(+type, width, height, alt)andtwitter:card=summary_large_imagewith the same title, description, image and alt text.index.html,game.zipandversion.txtfor a tak game, so the game's own host cannot serve the PNG. The tags therefore point athttps://raw.githubusercontent.com/Stephenson-Software/Overwinter/main/web/og.png(public repo, served asimage/png). The alternative, an arcade change that serves/og.pngout of a tak game's bundle, was not made here.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 -qon Python 3.12: 189 passed;tests/test_og_image.py+tests/test_web_build.pyalso pass on Python 3.8 (the CI matrix's other version). Newtests/test_og_image.py(4 tests): the PNG is 1200x630 and under 512 KB; each tag appears once; image URL, size and alt text matchrender_og.OG; preview title/description match the page.Notes
arcade.ymlruns on every push tomain), 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