Repository navigation
Fix SEO indexing: hreflang, canonicals, sitemap, trailing slash #2193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a2563d8
9565f22
5dbf4ec
991ecc3
cc1aef4
a5245ca
fe8c44e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import { Link } from "../../../../i18n/navigation"; | |
| export const metadata: Metadata = { | ||
| title: "Privacy Policy — cmux", | ||
| description: "Privacy policy for cmux", | ||
| alternates: { canonical: "./" }, | ||
| alternates: { canonical: "https://cmux.com/privacy-policy" }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: The new static Prompt for AI agents |
||
| }; | ||
|
|
||
| export default function PrivacyPolicyPage() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import type { Metadata } from "next"; | |
| export const metadata: Metadata = { | ||
| title: "Terms of Service — cmux", | ||
| description: "Terms of service for cmux", | ||
| alternates: { canonical: "./" }, | ||
| alternates: { canonical: "https://cmux.com/terms-of-service" }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This locale route now uses a single hardcoded canonical URL, which regresses locale-aware SEO signals. Generate metadata from Prompt for AI agents |
||
| }; | ||
|
|
||
| export default function TermsOfServicePage() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import { getTranslations } from "next-intl/server"; | ||
| import { buildAlternates } from "../../../i18n/seo"; | ||
| import { SiteHeader } from "../components/site-header"; | ||
| import { BlogPager } from "../components/blog-pager"; | ||
| import { BlogCTA } from "../components/blog-cta"; | ||
|
|
@@ -19,9 +20,7 @@ export async function generateMetadata({ | |
| siteName: "cmux", | ||
| type: "article" as const, | ||
| }, | ||
| alternates: { | ||
| canonical: "./", | ||
| }, | ||
| alternates: buildAlternates(locale, "/blog"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The blog layout emits |
||
| }; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import { getTranslations } from "next-intl/server"; | ||
| import { buildAlternates } from "../../../i18n/seo"; | ||
| import { DocsNav } from "./docs-nav"; | ||
| import { SiteHeader } from "../components/site-header"; | ||
|
|
||
|
|
@@ -18,9 +19,7 @@ export async function generateMetadata({ | |
| siteName: "cmux", | ||
| type: "article" as const, | ||
| }, | ||
| alternates: { | ||
| canonical: "./", | ||
| }, | ||
| alternates: buildAlternates(locale, "/docs"), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Setting Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The docs layout sets Before this PR the layout used To fully fix this, each docs page's // e.g. getting-started/page.tsx
alternates: buildAlternates(locale, "/docs/getting-started"),The same gap applies to |
||
| }; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: This metadata hardcodes an English canonical and omits hreflang alternates on a locale route, which can cause non-English EULA URLs to canonicalize incorrectly and lose locale signals.
Prompt for AI agents