Skip to content

docs site: add an og image and tighten seo metadata - #29

Merged
shivamhwp merged 2 commits into
shivamdoting:mainfrom
pc-style:docs/og-image-and-seo
Jul 30, 2026
Merged

docs site: add an og image and tighten seo metadata#29
shivamhwp merged 2 commits into
shivamdoting:mainfrom
pc-style:docs/og-image-and-seo

Conversation

@pc-style

@pc-style pc-style commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What this changes and why

Links to wrec.app unfurled as a bare summary card with no image. This adds a
social card and the metadata to point at it. No page content is touched: titles,
descriptions and the landing page are all unchanged.

  • Social card, generated at build time. docs/src/pages/og.png.ts is an
    Astro endpoint that renders the card with satori and resvg, so dist/og.png
    falls out of astro build on Vercel and in CI. Nothing binary is checked in
    and the card cannot drift from the site. It is the red field with the wrec
    wordmark at top left, reusing the local Departure Mono the site already
    ships. Costs about 1.6s of build time.
  • Seo.astro. Adds og:image (absolute URL, since crawlers reject relative
    paths), og:image:type/width/height/alt, twitter:card=summary_large_image
    with twitter:image, og:locale, robots with max-image-preview:large,
    and theme-color.

Two new docs-only dependencies, satori and @resvg/resvg-js. The lockfile
carries every resvg platform binary, so bun install --frozen-lockfile resolves
on the Linux builders as well as locally. Nothing outside docs/ is touched, so
recording memory and CPU behavior are unchanged.

How it was verified

  • bun run check (0 errors, 0 warnings) and bun run build in docs/

  • Confirmed dist/og.png is emitted at 1200x630 and visually reviewed it

  • Inspected the built HTML: absolute og:image on every page, page content
    identical to main

  • cargo fmt --check, cargo check, cargo test pass: n/a, no Rust changes

  • Exercised the affected flow (app / CLI / daemon) on macOS: n/a, docs site only

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

@pc-style is attempting to deploy a commit to the shivamdoting Team on Vercel.

A member of the Team first needs to authorize it.

@pc-style
pc-style marked this pull request as draft July 27, 2026 13:44
@pc-style
pc-style force-pushed the docs/og-image-and-seo branch 2 times, most recently from fedb82b to 16cfad2 Compare July 27, 2026 13:48
@pc-style
pc-style marked this pull request as ready for review July 27, 2026 13:49
@pc-style

Copy link
Copy Markdown
Contributor Author

update: the card is generated at build time now, not checked in.

first pass had a committed og.png plus a little weasyprint script to regenerate it. then i tried to make that a build step and it obviously can't be one. vercel builds this on linux, weasyprint and pdftoppm aren't there, so hooking it into astro build would just kill the deploy.

so it's an astro endpoint now. src/pages/og.png.ts renders the card with satori + resvg, dist/og.png falls out of the build anywhere. no binary in git, and the card can't drift from the site. output is pixel identical to the weasyprint one.

the tradeoff, so you can say no: two docs-only deps (satori, @resvg/resvg-js) and ~1.6s of build time for an image that changes basically never. a static committed png is arguably the more obvious call for an asset with zero inputs. the only thing generating it buys today is that it can't go stale. it starts actually paying off if the card ever wants per-page titles.

happy to go back to the committed png if you'd rather keep docs/ at one dependency. just say so.

titles and descriptions are untouched, that part got reverted.

one gotcha for review: the font is read via process.cwd(), not import.meta.url, because the endpoint gets bundled into dist/ before it runs. there's a comment on the line.

@pc-style
pc-style force-pushed the docs/og-image-and-seo branch from 16cfad2 to 46e0529 Compare July 27, 2026 14:01
@pc-style

Copy link
Copy Markdown
Contributor Author

update 2: pulled everything out of the landing page. the json-ld block is gone, index.astro is byte identical to main now. that page is yours.

card is stripped down too. red field, wrec at the top left, nothing else. no tagline, no footer row, no rule.

what's left is 4 files: the og endpoint, the meta tags in Seo.astro, and package.json + lockfile for satori and resvg. zero page content touched.

@pc-style
pc-style force-pushed the docs/og-image-and-seo branch from 46e0529 to 14bdef2 Compare July 27, 2026 14:07
@pc-style

pc-style commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

added the SoftwareApplication json-ld back to index.astro. head only, 14 lines, nothing visual changes

- add docs/src/pages/og.png.ts, an Astro endpoint that renders the card
  with satori and resvg during the build, so dist/og.png is generated
  rather than checked in
- Seo.astro now emits og:image with dimensions and alt text, a
  summary_large_image twitter card, og:locale, robots and theme-color

no page content changes: titles, descriptions and the landing page are
untouched.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019fa3c4-2cc1-760d-ae8f-60a2c3c237d0
@pc-style
pc-style force-pushed the docs/og-image-and-seo branch from 14bdef2 to 15fe478 Compare July 27, 2026 14:10

Copy link
Copy Markdown
Collaborator

The OG metadata looks good and the generated output works. I’d like to keep this more obvious: please commit the final PNG under docs/public/ and remove the Satori/Resvg build-time generator and dependencies. The image has no dynamic inputs today, so generation adds build time and native dependencies without preventing drift.

Please also remove the unrelated JSON-LD block for now, and make sure the final card matches the intended design (the discussion says wordmark-only, while the current endpoint still includes the tagline).

After that and a successful Vercel preview, this should be good to merge.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wrec Ready Ready Preview Jul 30, 2026 5:08pm

@shivamhwp
shivamhwp merged commit ac152c8 into shivamdoting:main Jul 30, 2026
5 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.

2 participants