Skip to content

Draw the social card instead of screenshotting the page - #170

Merged
xuelink merged 1 commit into
mainfrom
claude/bu-preview-gorsel-676528
Sep 11, 2026
Merged

Draw the social card instead of screenshotting the page#170
xuelink merged 1 commit into
mainfrom
claude/bu-preview-gorsel-676528

Conversation

@xuelink

@xuelink xuelink commented Sep 11, 2026

Copy link
Copy Markdown
Member

static/images/site-preview.png was a 1941x1180 shot of the whole homepage, so every scraper's 1.91:1 crop took the bottom third off it — a half-cut "Language learning is a rewarding journey!" and a beheaded phone — and it still carried the languageXchange wordmark, two redesigns ago.

The replacement is the hero rebuilt for 1200x630 out of the same material: white ground, Nunito 800 heading, the chat replica at the app's own sizes, the one yellow on the send slab, and a hairline round the edge so the card does not dissolve into a white feed.

What's in here

  • static/images/site-preview.png — the new card, 1200x630.
  • scripts/og/site-preview.html + render.mjs — the template and node scripts/og/render.mjs to re-cut it. Headless Chrome is the whole toolchain, no image library to keep installed; it rasterises at 1:1, which reads sharper than rendering at 2x and scaling back down.
  • meta.ts / Seo.svelteog:image:width/height and og:image:alt (plus twitter:image:alt). With the aspect ratio changed, declaring 1200x630 up front is what stops X and Slack guessing at the crop before the download finishes.
  • README.md — the Versioning section pointed at the same file, which is how it drifted: one image was serving as both the social card and the v0.2 record. The old shot moves to static/versioning/v0.2.png, next to v0.1, and the README follows it there.

Checks

npm run lint clean; npm run check 0 errors (the 3 warnings are the pre-existing text-wrap ones). Head tags verified on /welcome-back against the dev server — the page whose card prompted this.

🤖 Generated with Claude Code

`site-preview.png` was a 1941x1180 shot of the whole homepage, so every
scraper's 1.91:1 crop took the bottom third off it: a half-cut "Language
learning is a rewarding journey!" and a beheaded phone. It also still
carried the languageXchange wordmark, two redesigns ago.

The replacement is the hero rebuilt for 1200x630 out of the same material
— white ground, Nunito 800 heading, the chat replica at the app's own
sizes, the one yellow on the send slab — with a hairline round the edge
so the card does not dissolve into a white feed. `scripts/og/` keeps the
template and a render script, so the next cut is a command rather than
another screenshot.

`meta.ts` now declares the size and an alt line; with the aspect ratio
changed, saying 1200x630 up front is what stops X and Slack guessing at
the crop before the download finishes.

The README's Versioning section pointed at the same file, which is how it
drifted: one image was serving as both the social card and the v0.2
record. The old shot moves to `static/versioning/v0.2.png`, next to v0.1,
and the README follows it there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@xuelink
xuelink merged commit 50c7e9b into main Sep 11, 2026
1 check 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