feat(og): point every page at its own share card#71
Merged
Conversation
The 66 cards from #70 existed but nothing referenced them. BaseLayout resolves og:image and twitter:image through ogImagePath(toolId, locale), so /tools/gear-calculator advertises /og/zh/gear-calculator.png and its English twin advertises /og/en/gear-calculator.png. Pages with no toolId fall back to the home card. - twitter:card summary -> summary_large_image. The old value rendered a small square thumbnail, which is what the 512px logo was shaped for; a 1200x630 card needs the large variant or X crops it. - og:image:width / height / alt added. Facebook and LINE size the card from the tags before fetching the image, and skip the preview entirely on a cold cache if they have to guess. - meta name=author added. - The Chinese home description was 14 characters. Our own URL Audit scores anything under 50 as a warning, and it was right: the old text ("TTigger's tool collection and portfolio") said nothing about what the site does. Rewritten to name the tool families and the fact that nothing is uploaded. The English default was already 51 and stands. Tool pages already pass their own descriptions, so only the home default needed lengthening. e2e covers what unit tests can't reach here, since BaseLayout is an Astro component: the resolved og:image URL per locale, the card dimensions and twitter:card value, that the advertised image actually returns 200 image/png rather than a 404, and that the home description lands inside the 50-160 window the audit tool checks for. Tests: typecheck:api, 508 unit, 54 e2e (6 new). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
feat(og): point every page at its own share card
The 66 cards from #70 existed but nothing referenced them. BaseLayout
resolves og:image and twitter:image through ogImagePath(toolId, locale),
so /tools/gear-calculator advertises /og/zh/gear-calculator.png and its
English twin advertises /og/en/gear-calculator.png. Pages with no toolId
fall back to the home card.
small square thumbnail, which is what the 512px logo was shaped for;
a 1200x630 card needs the large variant or X crops it.
from the tags before fetching the image, and skip the preview entirely
on a cold cache if they have to guess.
scores anything under 50 as a warning, and it was right: the old text
("TTigger's tool collection and portfolio") said nothing about what
the site does. Rewritten to name the tool families and the fact that
nothing is uploaded. The English default was already 51 and stands.
Tool pages already pass their own descriptions, so only the home default
needed lengthening.
e2e covers what unit tests can't reach here, since BaseLayout is an
Astro component: the resolved og:image URL per locale, the card
dimensions and twitter:card value, that the advertised image actually
returns 200 image/png rather than a 404, and that the home description
lands inside the 50-160 window the audit tool checks for.
Tests: typecheck:api, 508 unit, 54 e2e (6 new).
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com