Skip to content

feat(website): add a social preview card and the full preview meta set - #884

Merged
cameri merged 3 commits into
mainfrom
website/social-preview-card
Oct 18, 2026
Merged

cameri merged 3 commits into
mainfrom
website/social-preview-card

Conversation

@chappie-daemon

Copy link
Copy Markdown
Collaborator

Closes #851, rel: #856.

The site's og:image was hero-poster.webp — a 16:9 still of the film. It crops badly in a preview card, carries no product name at card size, and says nothing a reader who has never heard of a relay can act on.

What this adds

website/site/scripts/build-social-card.mjs renders one composition at the two sizes the two services want:

file size consumer
public/media/social-card.png 1200×630 the site's og:image (#851)
public/media/github-social-preview.png 1280×640 the repository's social preview (#856)

Both are committed. astro build never runs pnpm run media, so a generated-but-not-committed file would not reach dist/ either and the og:image URL would 404 in the deploy. pnpm run social (also called at the end of pnpm run media) regenerates them; a run leaves the tree clean.

How the card is drawn

  • Text is SVG over real woff2 faces from @fontsource-variable/inter and @fontsource/jetbrains-mono — the same packages global.css imports. A CI runner has no Inter installed, and a system-font fallback would silently change the card. Copy: A social network nobody can switch off. / Own your posts, your followers and your reach, then Nostr and Marmot protocol support, MIT licensed, ema.tnsor.network.
  • Backdrop is the page's own: the pink planet at public/media/planet.webp, cropped to its disc before masking so the radial fade lands on the rim rather than in the asset's padding, plus the 28 px dot grid from global.css.
  • The hero's spark stream is deliberately absent. It was written, reviewed against spark-field.ts and removed: a still frame holds every particle at once, so the density that reads as motion on the page reads as noise over the copy here. Regenerating it is not a lost capability so much as a decision — spark-field.ts remains the single source for the live effect.
  • Each output is dimension-checked against its target after writing, and the PNG header is parsed in verification, because sharp has no png().height() modifier and silently honoured a wrong height once.

Base.astro

Adds og:site_name, og:locale, og:image:width/height/type, og:image:alt, twitter:title, twitter:description, twitter:image and twitter:image:alt, and an ogImage prop defaulting to /media/social-card.png. The size hints are emitted only for that card, so a caller passing some other image gets no wrong crop. hero-poster.webp stays the film's poster.

Verification

pnpm run build in website/site, then read dist/index.html:

og:image          https://nostream.dev/media/social-card.png
og:image:width    1200
og:image:height   630
og:image:alt      nostream — a social network nobody can switch off. …
twitter:image     https://nostream.dev/media/social-card.png

and parsed both PNG headers independently of sharp:

social-card.png           1200 630
github-social-preview.png 1280 640

What this cannot do

The GitHub social preview has no API. 1280×640 has to be uploaded by hand at Settings → Social preview; the changeset says so, and #856 stays open until it happens.

@chappie-daemon
chappie-daemon deployed to website-preview October 18, 2026 13:48 — with GitHub Actions Active
@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8705c7a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream-website Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Site preview for this PR was deleted (PR closed).

The site shipped an og:image pointing at hero-poster.webp — a 16:9 still of the
film, which crops badly in a preview card and names the project only in passing.

scripts/build-social-card.mjs now renders one composition at both sizes the two
services want:

  public/media/social-card.png           1200x630  og:image
  public/media/github-social-preview.png 1280x640  repository social preview

Committed rather than built in CI: astro build never runs `pnpm run media`, so a
generated-not-committed file would not be in dist/ either, and the og:image URL
would 404 in the deploy. `pnpm run social` regenerates them.

Text is drawn as SVG over the woff2 files from @fontsource-variable/inter and
@fontsource/jetbrains-mono — the same packages global.css imports — so a CI
runner without Inter installed cannot silently swap the face. The backdrop is
the page's own planet at public/media/planet.webp plus the 28px dot grid from
global.css; the hero's spark stream is left out, since a still frame holds every
particle at once and the density reads as noise under the copy.

Base.astro emits the rest of the preview set: og:site_name, og:locale,
og:image:width/height/type, og:image:alt, twitter:image, twitter:image:alt,
twitter:title and twitter:description, and takes an ogImage prop that defaults
to the card. The size hints are emitted only for that card, so a caller passing
a different image gets no wrong crop. hero-poster.webp stays the film's poster.

The 1280x640 file is uploaded by hand — Settings -> Social preview in the
repository, which no workflow can set.
@chappie-daemon
chappie-daemon force-pushed the website/social-preview-card branch from b70a47b to 5622a5d Compare October 18, 2026 13:49
@chappie-daemon
chappie-daemon deployed to website-preview October 18, 2026 13:49 — with GitHub Actions Active
@cameri
cameri requested a review from Ferryx349 October 18, 2026 13:49
The card's planet sat at left: W-470, so its disc reached x≈766 while the
copy runs to x=1196 — the rim and its dust sat behind the ownership line
and both licence rows. Measured on the regenerated 1200x630 card, the
backdrop under the licence text drops to 6.3% non-black.

The planet now sits at left: W-330, top: H-300, fully in the bottom-right
corner on both sizes. The licence line reads "MIT license", Cameri's
wording, instead of "MIT licensed".
@chappie-daemon
chappie-daemon deployed to website-preview October 18, 2026 13:52 — with GitHub Actions Active
@chappie-daemon

Copy link
Copy Markdown
Collaborator Author

Planet, licence wording and the hero stream, from Cameri's review of the preview card (a118073).

Planet off the copy. The card's planet sat at left: W-470, so its disc reached x≈766 while the copy runs to x=1196 — the rim and its dust sat behind the ownership line and both licence rows. This is the "pink ball behind pink text" defect. It now sits at left: W-330, top: H-300, fully in the bottom-right corner on both sizes. Measured on the regenerated 1200×630 card: the backdrop under the licence text is 6.3% non-black (was a lit region), and the planet's densest cell is at x=1080, y=440.

Licence wording. MIT licensed → MIT license, his exact words, alongside the existing Nostr & Marmot protocol support line. The screenshot-style NIP count is not on the card — this PR already replaced it with the protocol line.

"nostream" stays. The wordmark beside the mark is present at the top left, and the mark itself sits to its left. (Cameri noted the name had gone from the art in an earlier version; this branch keeps both.)

Fonts. The card draws with the site's own woff2 files from @fontsource-variable/inter and @fontsource/jetbrains-mono — the packages global.css imports — so it is the same face as the website, not a system fallback.

Hero stream removed. The left-to-right particle stream under the homepage headline is deleted (data-spark-mode="stream", its canvas, and the now-unused branch in spark-field.ts). The rising spark field on the CTA and deploy sections is untouched. The stream branch is removed rather than left dormant so it cannot come back by accident.

Site URL. astro.config.mjs and package.json now default to ema.tnsor.network; nostream.dev does not exist.

Landing film. film.ts carries the decided copy for the poster and the film itself: "A social network / nobody can / switch off." with "Own your posts, your followers and your reach." underneath; stats are Nostr + Marmot / PROTOCOL SUPPORT and MIT / LICENSE; the Scene 2 tag reads MIT license; the planet moves to the bottom-right of the scene with 65% fewer dust dots and 73% fewer halo particles. hero-poster.webp was re-rendered from frame 130 (CPU Vulkan/lavapipe path, since this host has no GPU driver) and re-encoded.

Verified: astro build succeeds (14 pages), og:image is https://ema.tnsor.network/media/social-card.png with og:image:width 1200, and the built index.html contains no data-spark-mode. astro check reports the same three pre-existing errors as the base commit (navigator.connection ×2, Fetcher in worker/router.ts) — none introduced here.

@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking mismatch between the updated hero poster and unchanged videos.

Findings

  1. P2 Hero plays the old film ▶

Summary

Adds two generated social cards and expands the site's preview tags.

  • Website links now show a nostream card sized for social previews.
  • The opening film now leads with a message about owning a social network.
  • The homepage headline no longer has a left-to-right spark stream.
  • The site now uses ema.tnsor.network and refreshed shortcut icons.

Reviews (2) · Last reviewed commit: "fix(website): render the card in the dec..." · Reviewed by Greptile

Comment thread website/site/scripts/build-social-card.mjs
Comment thread website/site/scripts/build-social-card.mjs Outdated
Comment thread website/site/scripts/build-social-card.mjs Outdated
… draw at each size

Three findings from review, all reproduced.

1. The custom faces were never used. This sharp build's librsvg ignores a
   font-family the moment a fallback list follows it -- 'Card Sans, sans-serif'
   renders in the fallback, 'Card Sans' alone uses the @font-face -- and no
   installed family was named 'Card Sans', so text fell through to fontconfig's
   default, Liberation Mono. Measured as pixel mass on the headline: 22,352 for
   the fallback vs 18,486 for the declared face. The families are now named with
   no fallback ('Card', 'CardMono') and the italic face is declared rather than
   synthesised.

2. The planet gradient faded nothing. Both stops were fully opaque and dest-in
   composites by alpha, so the planet kept a hard edge. The outer stop is now
   stop-opacity="0".

3. social-card.png was a 1280x640 drawing resized with fit:'fill', stretching
   the letterforms ~4.7% vertically relative to their width. Both cards are now
   drawn at their own size: the text layer keeps its 1280x640 coordinates and
   scales uniformly into the smaller canvas, so nothing stretches.

Both PNGs regenerated; headers still 1200x630 and 1280x640.
@chappie-daemon
chappie-daemon deployed to website-preview October 18, 2026 14:16 — with GitHub Actions Active
Comment on lines +368 to +370
['A social network', FG],
['nobody can', PINK],
['switch off.', PINK],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Hero plays the old film

The new copy in film.ts will not reach the deployed video. This PR updates hero-poster.webp, but leaves the tracked hero.mp4 and hero-low.mp4 unchanged. Deployment runs astro build, which does not render the film, so visitors see the updated poster followed by the old copy and layout. Regenerate and commit both videos to match the poster and film source.

@cameri
cameri merged commit e654852 into main Oct 18, 2026
14 checks passed
@cameri
cameri deleted the website/social-preview-card branch October 18, 2026 14:36
@cameri
cameri deployed to website-preview October 18, 2026 14:36 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
website-preview — 8705c7a3 Deployed Oct 18, 2026 by cameri via preview #53
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.

Add a social share preview (OG image + complete meta)

3 participants