Skip to content

Commit 37d0601

Browse files
authored
fix: add self-referencing canonical URLs across all pages (#122)
- Add alternates.canonical to the 17 static pages missing it (homepage, about, pricing, contact, download, products, legal pages); root-relative paths resolve against the existing metadataBase with trailing slashes matching trailingSlash: true - Add canonical to blog tag pages via generateMetadata - /zh/ and /en/ are client-side redirect shells and cannot export metadata; add segment layouts declaring their redirect targets as canonical (rustfs.com.cn and /), consistent with the hreflang cluster - Fix rustfs-config-generator canonical/og:url to include the trailing slash so they match the served URL form Verified: tsc passes, clean build passes, 73/75 built pages carry canonical (404 and _not-found intentionally excluded).
1 parent 329ffb0 commit 37d0601

21 files changed

Lines changed: 57 additions & 3 deletions

File tree

‎app/about/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { Metadata } from "next"
66
import type { ComponentType } from "react"
77

88
export const metadata: Metadata = {
9+
alternates: { canonical: "about/" },
910
title: "About RustFS | Next-Generation Distributed Object Storage for AI",
1011
description: "Learn about RustFS, an Apache 2.0 open-source distributed object storage system built in Rust. Powering AI data centers with native RDMA and DPU acceleration.",
1112
keywords: "about RustFS, RustFS project, open source object storage, distributed object storage, Rust infrastructure, NVIDIA Inception, RDMA storage, DPU hardware acceleration",

‎app/blog/tag/[tag]/page.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export async function generateStaticParams() {
1818
export async function generateMetadata({ params }: { params: Promise<{ tag: string }> }): Promise<Metadata> {
1919
const { tag } = await params;
2020
const label = await findTag(tag);
21-
return { title: label ? `${label} | RustFS Blog` : "RustFS Blog" };
21+
return {
22+
title: label ? `${label} | RustFS Blog` : "RustFS Blog",
23+
alternates: { canonical: `/blog/tag/${tag}/` },
24+
};
2225
}
2326

2427
export default async function BlogTagPage({ params }: { params: Promise<{ tag: string }> }) {

‎app/contact-us/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import ContactForm from '@/components/business/contact-form'
22
import type { Metadata } from 'next'
33

44
export const metadata: Metadata = {
5+
alternates: { canonical: "contact-us/" },
56
title: "Contact Us | RustFS | The High-Performance, Apache 2.0 Object Storage for AI",
67
description: 'Get in touch with the RustFS team. Contact us for questions, support, or partnership opportunities.',
78
openGraph: {

‎app/contact/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import ContactForm from '@/components/business/contact-form'
22
import type { Metadata } from 'next'
33

44
export const metadata: Metadata = {
5+
alternates: { canonical: "contact/" },
56
title: "Contact Us | RustFS | The High-Performance, Apache 2.0 Object Storage for AI",
67
description: 'Get in touch with the RustFS team. Contact us for questions, support, or partnership opportunities.',
78
openGraph: {

‎app/cookie-policy/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Metadata } from 'next'
33
import { CookieSettingsButton } from '@/components/business/cookie-consent'
44

55
export const metadata: Metadata = {
6+
alternates: { canonical: "cookie-policy/" },
67
title: 'Cookie Policy | RustFS',
78
description: 'Learn how RustFS uses cookies and similar technologies on the official website.',
89
}

‎app/demo/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const notices = [
3636
];
3737

3838
export const metadata: Metadata = {
39+
alternates: { canonical: "demo/" },
3940
title: "RustFS Demo | Public Demo Environment",
4041
description:
4142
"Review the RustFS public demo credentials, daily reset schedule, and data safety notice before entering the demo environment.",

‎app/download/cli/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getLatestCliRelease } from '@/lib/github';
33
import type { Metadata } from 'next';
44

55
export const metadata: Metadata = {
6+
alternates: { canonical: "download/cli/" },
67
title: 'Download RustFS CLI Client (rc) | Multi-Platform Install',
78
description: 'Install the RustFS rc command-line client with a package manager, native binary, Docker, or source build.',
89
};

‎app/download/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import DownloadPageClient from './components/download-page-client';
22
import type { Metadata } from 'next';
33

44
export const metadata: Metadata = {
5+
alternates: { canonical: "download/" },
56
title: "Download & Install RustFS | Multi-OS & Cloud-Native Deployment",
67
description: 'Download RustFS Server and native CLI (rc). Install seamlessly on Linux, macOS, Windows, and NixOS using pre-built binaries, Docker images, or Kubernetes.',
78
keywords: 'download RustFS, install RustFS, RustFS binary, RustFS Docker, RustFS Kubernetes, RustFS CLI, RustFS command line, NixOS object storage, S3 server download, macOS, Linux, Windows, nixos',

‎app/download/server/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getLatestRelease } from '@/lib/github';
33
import type { Metadata } from 'next';
44

55
export const metadata: Metadata = {
6+
alternates: { canonical: "download/server/" },
67
title: 'Download RustFS Server | Linux, Docker & Kubernetes',
78
description: 'Install the RustFS server with a Linux binary, Docker, Compose, Kubernetes, macOS, or Windows.',
89
};

‎app/en/layout.tsx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Metadata } from "next";
2+
3+
// `/en/` client-redirects to the homepage; declare the homepage as canonical
4+
// so search engines consolidate this duplicate URL into it.
5+
export const metadata: Metadata = {
6+
alternates: {
7+
canonical: "/",
8+
},
9+
};
10+
11+
export default function EnLayout({
12+
children,
13+
}: Readonly<{
14+
children: React.ReactNode;
15+
}>) {
16+
return children;
17+
}

0 commit comments

Comments
 (0)