docs site: add an og image and tighten seo metadata - #29
Conversation
|
@pc-style is attempting to deploy a commit to the shivamdoting Team on Vercel. A member of the Team first needs to authorize it. |
fedb82b to
16cfad2
Compare
|
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. 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. |
16cfad2 to
46e0529
Compare
|
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. |
46e0529 to
14bdef2
Compare
|
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
14bdef2 to
15fe478
Compare
|
The OG metadata looks good and the generated output works. I’d like to keep this more obvious: please commit the final PNG under 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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
What this changes and why
Links to wrec.app unfurled as a bare
summarycard with no image. This adds asocial card and the metadata to point at it. No page content is touched: titles,
descriptions and the landing page are all unchanged.
docs/src/pages/og.png.tsis anAstro endpoint that renders the card with satori and resvg, so
dist/og.pngfalls out of
astro buildon Vercel and in CI. Nothing binary is checked inand 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. Addsog:image(absolute URL, since crawlers reject relativepaths),
og:image:type/width/height/alt,twitter:card=summary_large_imagewith
twitter:image,og:locale,robotswithmax-image-preview:large,and
theme-color.Two new docs-only dependencies,
satoriand@resvg/resvg-js. The lockfilecarries every resvg platform binary, so
bun install --frozen-lockfileresolveson the Linux builders as well as locally. Nothing outside
docs/is touched, sorecording memory and CPU behavior are unchanged.
How it was verified
bun run check(0 errors, 0 warnings) andbun run buildindocs/Confirmed
dist/og.pngis emitted at 1200x630 and visually reviewed itInspected the built HTML: absolute
og:imageon every page, page contentidentical to
maincargo fmt --check,cargo check,cargo testpass: n/a, no Rust changesExercised the affected flow (app / CLI / daemon) on macOS: n/a, docs site only