Skip to content

feat(website): per-page Open Graph cards for /quickstart and /features/cli#196

Merged
montfort merged 1 commit into
mainfrom
feat/og-per-page-overrides
May 22, 2026
Merged

feat(website): per-page Open Graph cards for /quickstart and /features/cli#196
montfort merged 1 commit into
mainfrom
feat/og-per-page-overrides

Conversation

@montfort
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #193 (sitewide branded card). Adds page-specific Open Graph cards for the two highest-impact internal pages.

Cards

/quickstartstatic/img/og/quickstart.png

quickstart-card

/features/clistatic/img/og/cli.png

cli-card

Both use the same template as the sitewide card (dark #0E0E10 background, white wordmark, teal #25C2A0 accent, attribution) and swap only the tagline, the two pillar rows, and the URL footer.

SVG sources live next to the PNGs (static/img/og/{quickstart,cli}.svg). Same inkscape render command in the README of #193 applies.

Wiring

image: frontmatter on the source MDX of each page across the three locales:

  • website/src/pages/quickstart.mdx
  • website/i18n/es/docusaurus-plugin-content-pages/quickstart.mdx
  • website/i18n/zh-CN/docusaurus-plugin-content-pages/quickstart.mdx
  • website/src/pages/features/cli.mdx
  • website/i18n/es/docusaurus-plugin-content-pages/features/cli.mdx
  • website/i18n/zh-CN/docusaurus-plugin-content-pages/features/cli.mdx

Card design is intentionally locale-agnostic — the same PNG is referenced from all three locale versions of each page.

Gotcha: absolute URL in frontmatter

@docusaurus/plugin-content-pages resolves a frontmatter image: img/... relative to the current locale's baseUrl. For /es/quickstart that ended up pointing at /es/img/og/quickstart.png — a 404, because the static asset only lives at /img/og/... (no locale split). Used absolute URLs (https://straymark.dev/img/og/...) to bypass the resolution, which matches what themeConfig.image ends up serializing to anyway.

Pages NOT changed

Page Card
/ Sitewide straymark.png — already correct as the broad-strokes landing card
/blog index Sitewide. The blog plugin doesn't expose a per-instance OG image config; would need a swizzle.
Individual blog posts (×14) Sitewide. Each post would benefit from a custom card but the maintenance cost outweighs the value right now. Defer to dynamic generation if/when we want them.
Other /features/* (×8) Sitewide. Each has comparatively niche shareability vs. CLI / quickstart.
/privacy, /docs/* Sitewide.

Test plan

After deploy:

  • Each of the 6 locale+page combinations renders og:image pointing at the right card (verified in build)
  • opengraph.xyz preview of https://straymark.dev/quickstart shows the quickstart card
  • opengraph.xyz preview of https://straymark.dev/features/cli shows the CLI card
  • opengraph.xyz preview of https://straymark.dev/ (landing) still shows the sitewide card — unchanged
  • Paste the three URLs into Slack / X / LinkedIn → each unfurls with its respective card

🤖 Generated with Claude Code

…s/cli

Two pages now have their own social card, layered on top of the
sitewide card shipped in #193. Both follow the same template (dark
#0E0E10 background, white wordmark, teal accent, attribution) and only
swap the tagline, the two pillar rows, and the URL footer:

  /quickstart  →  "Your first Charter, closed in 10–15 minutes."
                  declare → execute → log → validate → audit
                  Six sections · copy-paste commands · one Rust binary

  /features/cli → "One Rust binary. Eleven commands. No daemons."
                  init · validate · audit · analyze · compliance · ...
                  Deterministic outputs you can grep, jq, pipe to CI.

Wired via the `image:` frontmatter on the source MDX in each of the
three locales (en/es/zh-CN). Card design is intentionally locale-
agnostic — the visuals work the same regardless of which language the
linked page renders in.

Gotcha worth noting: Docusaurus' plugin-content-pages prefixes the
locale path onto a frontmatter `image: img/...`, so the meta tag would
point at /es/img/og/quickstart.png (a 404). Used absolute URLs
(https://straymark.dev/img/og/...) to bypass that resolution — same
domain as `themeConfig.image` resolves to anyway, so consistent.

Blog index intentionally not addressed (the blog plugin doesn't expose
a per-instance OG image config without swizzling).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@montfort montfort merged commit 6d88a51 into main May 22, 2026
1 check passed
@montfort montfort deleted the feat/og-per-page-overrides branch May 22, 2026 04:15
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