Skip to content

Commit 9f77b41

Browse files
committed
docs(seo): use trailing-slash home URL for canonical/og/sitemap (matches 200 URL, avoids 301)
1 parent 73709f2 commit 9f77b41

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/app/[[...mdxPath]]/page.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const generateStaticParams = generateStaticParamsFor('mdxPath')
88

99
const pageUrl = (mdxPath) => {
1010
const slug = (mdxPath ?? []).join('/')
11-
return slug ? `${SITE_URL}/${slug}` : SITE_URL
11+
return slug ? `${SITE_URL}/${slug}` : `${SITE_URL}/`
1212
}
1313

1414
const titleText = (metadata) => {

docs/app/layout.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ export const metadata = {
4141
],
4242
icons: { icon: logoSrc, apple: logoSrc, shortcut: logoSrc },
4343
manifest: `${basePath}/manifest.webmanifest`,
44-
alternates: { canonical: SITE_URL },
44+
alternates: { canonical: `${SITE_URL}/` },
4545
openGraph: {
4646
type: 'website',
4747
locale: 'en_US',
48-
url: SITE_URL,
48+
url: `${SITE_URL}/`,
4949
siteName: 'Zaileys',
5050
title: 'Zaileys — Simplified WhatsApp API for Node.js & TypeScript',
5151
description: DESCRIPTION,

docs/app/sitemap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const dynamic = 'force-static'
2727
export default function sitemap(): MetadataRoute.Sitemap {
2828
const lastModified = new Date()
2929
return PAGES.map((slug) => ({
30-
url: slug ? `${SITE_URL}/${slug}` : SITE_URL,
30+
url: slug ? `${SITE_URL}/${slug}` : `${SITE_URL}/`,
3131
lastModified,
3232
changeFrequency: slug ? 'weekly' : 'daily',
3333
priority: slug ? (['getting-started', 'installation'].includes(slug) ? 0.9 : 0.8) : 1,

0 commit comments

Comments
 (0)