fix: add missing meta tags for Twitter/X social card images#818
Merged
aaronpowell merged 1 commit intostagedfrom Feb 25, 2026
Merged
fix: add missing meta tags for Twitter/X social card images#818aaronpowell merged 1 commit intostagedfrom
aaronpowell merged 1 commit intostagedfrom
Conversation
Add og:image:width, og:image:height, og:image:type, and twitter:image:alt meta tags so Twitter/X can properly display the social card image when links are shared. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes social card image rendering on Twitter/X by adding missing Open Graph and Twitter meta tags to the website's base layout. While the social cards worked correctly on LinkedIn, Twitter's crawler requires specific dimension and type metadata to avoid timeouts and properly render images.
Changes:
- Added Open Graph image metadata (
og:image:type,og:image:width,og:image:height) to help Twitter validate the social card image - Added Twitter-specific alt text (
twitter:image:alt) for accessibility
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.
Summary
Social card images display correctly on LinkedIn but not on X (Twitter). This adds the missing meta tags that Twitter's crawler needs to properly render the card image.
Changes
Added to
website/src/layouts/BaseLayout.astro:og:image:widthandog:image:height— Twitter's crawler uses these to validate image dimensions without downloading the file. Without them, the crawl can timeout and skip the image.og:image:type— helps Twitter identify the image format during content negotiation.twitter:image:alt— provides alt text for the card image (accessibility best practice).Testing
After deploy, verify with Twitter's Card Validator to confirm the image renders.