Skip to content

Commit 717bce4

Browse files
committed
Fix canonical
1 parent b38b299 commit 717bce4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/routes/schemas.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function describeDeclaration(d: Declaration, gameName: string): string {
5858
return `${prefix}.`;
5959
}
6060

61-
export const meta: MetaFunction = ({ params, location }) => {
61+
export const meta: MetaFunction = ({ params }) => {
6262
const gameName = params.game && isGameId(params.game) ? getGameDef(params.game)?.name : null;
6363
const { module, scope } = params;
6464

@@ -83,8 +83,8 @@ export const meta: MetaFunction = ({ params, location }) => {
8383
description = `Browse and explore Valve Source 2 engine schemas, classes, enums, and types for ${gameList}.`;
8484
}
8585

86-
const path = location.pathname.replace(/\/$/, "");
87-
const canonicalUrl = `${SITE_ORIGIN}/SchemaExplorer${path}`;
86+
const canonicalPath = [params.game, params.module, params.scope].filter(Boolean).join("/");
87+
const canonicalUrl = `${SITE_ORIGIN}/SchemaExplorer/${canonicalPath}`;
8888

8989
return [
9090
{ title },

0 commit comments

Comments
 (0)