Skip to content

Commit 24ab97d

Browse files
committed
update
1 parent bf3e46d commit 24ab97d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/app/[locale]/layout.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import { appConfig, type LocaleType } from "@/config";
33
import getRequestConfig from "@/i18n";
4-
import { cn, createAlternates, getCanonical } from "@/lib/utils";
4+
import { cn, createAlternates } from "@/lib/utils";
55
import { GoogleAnalytics } from '@next/third-parties/google';
66
import type { Metadata } from "next";
77
import { NextIntlClientProvider } from "next-intl";
@@ -30,10 +30,7 @@ export async function generateMetadata({ params }:{ params: any }): Promise<Meta
3030
template: `%s - ${appConfig.appRootDomain}`,
3131
},
3232
description: t('frontend.meta.default.description'),
33-
alternates: createAlternates({
34-
canonical: getCanonical({headers: headersList}),
35-
headers: headersList
36-
})
33+
alternates: createAlternates({ headers: headersList })
3734
};
3835
}
3936

src/lib/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const getCanonical = ({ headers }: { headers: Headers }) => {
1919
return `${origin}${url.pathname}`;
2020
}
2121

22-
export const createAlternates = ({ headers, canonical }: { headers: Headers; canonical: string; }) => {
22+
export const createAlternates = ({ headers }: { headers: Headers; }) => {
2323
let languages = {} as Record<LocaleType, string>;
2424
const linkStr = headers.get("Link")!;
2525
const links = linkStr.split(',');
@@ -35,7 +35,7 @@ export const createAlternates = ({ headers, canonical }: { headers: Headers; can
3535
})
3636

3737
return {
38-
canonical,
38+
canonical: getCanonical({ headers }),
3939
languages
4040
}
4141
}

0 commit comments

Comments
 (0)