Repository navigation
Give each blog post its own link-preview card - #21
Merged
Merged
Conversation
A local Docusaurus plugin draws a 1200x630 PNG per post with Satori and resvg: the post's title in Bungee on the site's paper and grain, the protocol's name above a 2px rule, and the authors and date below. Ink and gray only. Cards are written to static/img/og/ when content loads, so the dev server and the build both serve them; the directory is generated and ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Override BlogPostPage/Metadata so a post without its own `image` front matter links its card, and replace the site-wide image alt text with the post's title. A post that sets `image` keeps it, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every page on the site, blog posts included, shares one link-preview image: the GAP wordmark. A shared blog link doesn't show which post it is until someone opens it.
Changes
documentation/plugins/social-cards/) that renders a 1200×630 PNG for each blog post with Satori and resvg. Each card shows the post's title in Bungee on the site's paper and grain, "Governed Artifact Protocol" above a 2px rule, and the authors and date below. It uses only ink and gray. Long titles step down in size and stop at four lines.static/img/og/when content loads, so the dev server and the build both serve them. Git ignores that directory, and editing a title regenerates its card.BlogPostPage/Metadataso a post without its ownimagefront matter links its card asog:imageandtwitter:image, with alt text built from the post's title. A post that setsimagekeeps it, and every other page keeps the default card.satoriand@resvg/resvg-jsas dev dependencies of the documentation site.This is a documentation-site-only change. It changes nothing in the protocol, the schemas, the examples, or the demo.
Verification
pnpm docs:test: 19 tests pass, including new ones for the card path and the PNG dimensions.pnpm --dir documentation typecheckpnpm docs:buildandDOCS_BASE_URL=/governed-artifact-protocol/ pnpm docs:build: in both,/blog/hello-worldhas anog:imagethat points at its card under the base URL and replaces the site default rather than appearing alongside it. Other pages still useimg/social-card.png.🤖 Generated with Claude Code