feat(seo): canonicals, per-page metadata, and OG url/type/site_name - #1087
Open
mdo wants to merge 1 commit into
Open
feat(seo): canonicals, per-page metadata, and OG url/type/site_name#1087mdo wants to merge 1 commit into
mdo wants to merge 1 commit into
Conversation
Every route was missing rel=canonical, and 15 of 22 routes shared a title/description. Adds a pageMetadata helper (docs) that emits a self-referencing canonical, og:url/og:type/og:site_name, and correct per-site card images, then applies it across the docs routes; diffshub home/layout get the same OG fields and a canonical. Also fixes the trees title collision (all 10 routes shared one title) and trims the 70-char /theme title. Canonicals are declared per-page rather than in the layout so query-string variants (e.g. /playground?theme=) collapse onto one indexable URL without child routes inheriting the wrong canonical.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This was referenced Aug 19, 2026
necolas
approved these changes
Aug 20, 2026
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
rel="canonical". Adds a self-referencing canonical to all docs routes and the diffshub home. Canonicals are declared per page, not in the layout, so query-string variants (e.g./playground?theme=…) collapse onto one indexable URL without child routes inheriting the wrong canonical."Trees, from Pierre"), gives every route its own title/description, and trims the 70-char/themetitle to ~49 chars.og:url,og:type, andog:site_namesite-wide.apps/docs/lib/page-metadata.tscentralizes this because Next.js replaces nestedopenGraph/twitterobjects from parent segments instead of deep-merging, so each page must restate its full card.Excludes JSON-LD structured data and demo/pipes noindex by design (kept for separate follow-ups).
Test plan
<link rel="canonical"><title>og:url/og:type/og:site_namepresent site-widemoonx docs:typecheck(passing) andmoonx diffshub:typecheckStacked on #1086 (4 of 4).