feat(pages): add social preview meta tags and og-image#414
Merged
Conversation
Add description, Open Graph, and Twitter Card meta tags to the site's index.html, plus an og-image.png asset. Fixes link previews in messaging apps (iMessage, WeChat, Slack, etc.) showing no description or thumbnail when the site URL is unfurled into a card.
Contributor
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| <meta property="og:image" content="https://open-codereview.ai/og-image.png" /> | ||
|
|
||
| <!-- Twitter / X --> | ||
| <meta name="twitter:card" content="summary" /> |
Contributor
There was a problem hiding this comment.
Minor suggestion: Consider using summary_large_image instead of summary for the Twitter card type if you want the image to be displayed prominently in link previews. The summary card type shows a small thumbnail, while summary_large_image displays a full-width image, which typically results in better engagement. If the small thumbnail is intentional, this can be ignored.
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.
What
Add social sharing metadata to the landing site so URLs unfurl into rich cards in messaging apps and social platforms.
<meta name="description">topages/index.html.og:type,og:site_name,og:url,og:title,og:description,og:image).twitter:card=summary, title, description, image).pages/public/og-image.png(128×128 logo).CopyPlugincopies it intodist/, so it is served athttps://open-codereview.ai/og-image.png.Why
When
https://open-codereview.aiwas shared in messaging apps (iMessage, WeChat, Slack, etc.), the preview card showed only the title and URL — no description and no thumbnail. The root cause was thatindex.htmlhad only a<title>and no description / Open Graph / Twitter Card tags. Because the site is a client-rendered SPA and crawlers do not execute JS, these tags must be present in the static HTML.twitter:cardis set tosummary(small square) rather thansummary_large_image, matching the square logo asset.Notes