Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/api-reference/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@ export async function generateMetadata(
return {
title: page.data.title,
description: page.data.description,
alternates: {
canonical: `/api-reference/${params.slug?.join("/") ?? ""}`,
},
};
}
3 changes: 3 additions & 0 deletions src/app/developing/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ export async function generateMetadata(
return {
title: page.data.title,
description: page.data.description,
alternates: {
canonical: `/developing/${params.slug?.join("/") ?? ""}`,
},
};
}
3 changes: 3 additions & 0 deletions src/app/guide/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ export async function generateMetadata(
return {
title: page.data.title,
description: page.data.description,
alternates: {
canonical: `/guide/${slug?.join("/") ?? ""}`,
},
};
}
1 change: 1 addition & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Metadata } from "next/types";
import { Footer } from "@/src/components/Footer";

export const metadata: Metadata = {
metadataBase: new URL("https://docs.logchimp.codecarrot.net"),
title: {
template: "%s | LogChimp Docs",
default: "LogChimp Docs",
Expand Down
3 changes: 3 additions & 0 deletions src/app/platform/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ export async function generateMetadata(
return {
title: page.data.title,
description: page.data.description,
alternates: {
canonical: `/platform/${params.slug?.join("/") ?? ""}`,
},
Comment on lines +44 to +46
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Trailing slash on index pages.

When params.slug is undefined (the index route), this produces /platform/ (with a trailing slash), whereas sub-pages get /platform/setup (no trailing slash). This inconsistency can cause search engines to treat them as different URLs.

Consider trimming the trailing slash:

Proposed fix
    alternates: {
-     canonical: `/platform/${params.slug?.join("/") ?? ""}`,
+     canonical: params.slug ? `/platform/${params.slug.join("/")}` : "/platform",
    },

The same pattern applies to all six page files in this PR.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
alternates: {
canonical: `/platform/${params.slug?.join("/") ?? ""}`,
},
alternates: {
canonical: params.slug ? `/platform/${params.slug.join("/")}` : "/platform",
},
🤖 Prompt for AI Agents
In `@src/app/platform/`[[...slug]]/page.tsx around lines 44 - 46, The
alternates.canonical value currently builds `/platform/${params.slug?.join("/")
?? ""}` which yields a trailing slash when params.slug is undefined; update the
logic in the page component so canonical is `/platform` for the index and
`/platform/<joined-slug>` for subpages (e.g., use a conditional on params.slug
or trim the final slash) — apply the same change to the other five page files
that use the same pattern; target the alternates.canonical assignment and the
params.slug usage to make this change.

};
}
3 changes: 3 additions & 0 deletions src/app/self-hosting/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ export async function generateMetadata(
return {
title: page.data.title,
description: page.data.description,
alternates: {
canonical: `/self-hosting/${params.slug?.join("/") ?? ""}`,
},
};
}
3 changes: 3 additions & 0 deletions src/app/site-policy/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ export async function generateMetadata(
return {
title: page.data.title,
description: page.data.description,
alternates: {
canonical: `/site-policy/${params.slug?.join("/") ?? ""}`,
},
};
}
Loading