Skip to content

Commit

Permalink
Added canonical URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Oct 30, 2023
1 parent 434734b commit 1983023
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/[versionSlug]/[...pagePath]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export async function generateMetadata({
const titleText = getTextContent(title);
return {
title: titleText + " - AE2 Players Guide for " + guide.gameVersion,
alternates: {
canonical: getPagePath(guide, pageId),
},
};
} else {
return {};
Expand Down
1 change: 1 addition & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PropsWithChildren } from "react";

export const metadata: Metadata = {
title: "AE2 Players Guide",
metadataBase: new URL("https://guide.appliedenergistics.org"),
};

export default function RootLayout({ children }: PropsWithChildren) {
Expand Down
7 changes: 7 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import {
GuideVersion,
guideVersions,
} from "../build-data/GuideVersionIndex.ts";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "AE2 Players Guide",
alternates: {
canonical: "/",
},
};
function GuideVersion({ version }: { version: GuideVersion }) {
const lastUpdate = new Date(version.generated);

Expand Down

0 comments on commit 1983023

Please sign in to comment.