Repository navigation
feat(cards): name the product on a quickstart page's social card - #36
Merged
Merged
Conversation
Every product's quickstart page is titled "Quickstart", so the five cards drawn for them carried identical text and could come out as identical PNG bytes, and their og:image:alt was the same generic word. The card title and its alt text now go through one shared helper that names the product the page was copied from; the pages' own headings, sidebar labels and URLs are unchanged. Co-Authored-By: Yigit Tanriverdi <[email protected]>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Review of the first rendering showed the product name wrapping onto an orphan line of its own. The card title now leads with the product, and a quickstart page without its own description falls back to one concise line naming the product instead of the site-wide default. Co-Authored-By: Yigit Tanriverdi <[email protected]>
Member
|
APPROVE from independent Codex review of exact The shared title helper supplies the image and alt text. The authored description stays first in the fallback order. Independent Windows |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What and why
Every product's quickstart page is titled "Quickstart", so the five Open Graph cards drawn for them carried identical title text and could come out as identical PNG bytes (reproduced on ID and Guard), and their
og:image:altwas the same generic word. A media preview of a shared quickstart link could not tell one product's card from another's.The card title and its alt text now go through one shared pure helper (
cardTitleinsrc/social-card.ts) that names the product the page was copied from (entry.data.source.product), product first: the ID card reads "Gateweave ID quickstart", the Guard card "Gateweave Guard quickstart". Putting the product first also keeps it off an orphan line of its own. When such a page has no description of its own, the card falls back to one concise line naming the product — "Set up Gateweave ID on your own Cloudflare account." — instead of the site-wide default. Any other page, and any authored description, is untouched.Unchanged on purpose: the pages' own headings, the sidebar labels, canonical URLs, generated source files, the card's look and logo.
Where the change belongs
src/content/docs/, andpublic/<product>/,public/markdown/andsrc/generated/, are written bypnpm sync; a fixto their text goes to the product's own repository.
Only
src/social-card.ts,src/routeData.ts,src/pages/og/[...slug].tsand the test file change.How it was tested
pnpm verifypnpm verifygreen at the exact headd4740c4f38b451989c28729859a181e1235643b6: Biome and type checks, 108/108 tests, 67 pages built, internal links valid, social card and llms.txt checks pass.New regression test: two products produce distinct quickstart card titles, the product leads the title, the fallback description names the product and differs per product, the no-product fallbacks keep the bare title and no description, and a non-quickstart title is never rewritten.
Both cards re-rendered and visually checked: the ID card holds "Gateweave ID quickstart" on one line with its fallback line beneath; the Guard card breaks after "Gateweave Guard" with no orphaned product fragment.
The built PNGs (final assets at this head):
dist/og/id/quickstart.pngd21c3231b280d4ff90b43e21960c5d18c20a250299b6b61549881c83ffbe7534dist/og/guard/quickstart.pngbe129b4d01078f7ff0fc9105da671ce268e5f20db6855790f5b95cc7cf72ced0Built
og:image:altper product:Gateweave ID quickstart/Gateweave Guard quickstart/Gateweave Track quickstart, whileog:titleand the page heading stay "Quickstart".Link to Devin session: https://app.devin.ai/sessions/3b1e78af34ad411493440e1a25ee171e
Open in Devin Desktop: https://app.devin.ai/desktop/session/3b1e78af34ad411493440e1a25ee171e?variant=devin
Requested by: @[REDACTED SECRET]