Skip to content

feat(pages): add social preview meta tags and og-image#414

Merged
lizhengfeng101 merged 1 commit into
mainfrom
feat/pages-og-meta
Jul 21, 2026
Merged

feat(pages): add social preview meta tags and og-image#414
lizhengfeng101 merged 1 commit into
mainfrom
feat/pages-og-meta

Conversation

@lizhengfeng101

Copy link
Copy Markdown
Collaborator

What

Add social sharing metadata to the landing site so URLs unfurl into rich cards in messaging apps and social platforms.

  • Add <meta name="description"> to pages/index.html.
  • Add Open Graph tags (og:type, og:site_name, og:url, og:title, og:description, og:image).
  • Add Twitter Card tags (twitter:card=summary, title, description, image).
  • Add pages/public/og-image.png (128×128 logo). CopyPlugin copies it into dist/, so it is served at https://open-codereview.ai/og-image.png.

Why

When https://open-codereview.ai was 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 that index.html had 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:card is set to summary (small square) rather than summary_large_image, matching the square logo asset.

Notes

  • Requires a redeploy (GitHub Pages) to take effect; crawler caches may need a forced re-fetch (e.g. Facebook Sharing Debugger).

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.
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 1 comment(s)

Comment thread pages/index.html
<meta property="og:image" content="https://open-codereview.ai/og-image.png" />

<!-- Twitter / X -->
<meta name="twitter:card" content="summary" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MuoDoo MuoDoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@css521 css521 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit d0caa8a into main Jul 21, 2026
7 checks passed
@lizhengfeng101
lizhengfeng101 deleted the feat/pages-og-meta branch July 21, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants