Skip to content

[docs] Fix SEO preview: page-specific social card render#1735

Open
ahmedsadid wants to merge 3 commits into
facebook:mainfrom
ahmedsadid:issue-1550-seo
Open

[docs] Fix SEO preview: page-specific social card render#1735
ahmedsadid wants to merge 3 commits into
facebook:mainfrom
ahmedsadid:issue-1550-seo

Conversation

@ahmedsadid

Copy link
Copy Markdown
Contributor

What changed / motivation ?

Fixes two issues with the site's link/SEO previews.

1. Relative preview-image URL. og:image / twitter:image were served as a root-relative path (/assets/…png), which external crawlers can't always resolve.

  • Added src/lib/site.ts with a shared SITE_URL (also used by the RSS feed).
  • Made the image URLs absolute; added og:url, og:site_name, og:image:width/height, and *:image:alt.

2. Every page shared the homepage's card. Pages set their own <title> but inherited the layout's hardcoded og:title / og:description, so sharing any post showed the generic homepage preview.

  • New <Seo> component renders per-page description / og:title / og:description / twitter:title / twitter:description.
  • Removed those from the global layout (kept only invariant tags) — React does not de-duplicate meta tags, so a default + per-page tag would emit two conflicting og:titles.
  • Wired <Seo> into home, docs, blog, and playground.
  • Blog posts have no description frontmatter, so it's auto-derived from the post's opening paragraph(s) via src/lib/excerpt.ts.

Linked PR/Issues

Part of #1550

Additional Context

This PR builds on the blog-timestamp PR — both touch rss.ts and the blog page, so please merge that one first.

Pre-flight checklist

ahmedsadid and others added 3 commits June 23, 2026 07:14
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@ahmedsadid is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 23, 2026
@ahmedsadid ahmedsadid marked this pull request as ready for review June 23, 2026 14:41
@ahmedsadid ahmedsadid requested review from mellyeliu and nmn as code owners June 23, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant