diff --git a/package-lock.json b/package-lock.json index 20614db..44a76e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "redirectcheck", - "version": "0.1.3.rc", + "version": "0.1.4.rc", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "redirectcheck", - "version": "0.1.3.rc", + "version": "0.1.4.rc", "dependencies": { "@hookform/resolvers": "^3.9.0", "@next/third-parties": "^14.2.5", diff --git a/package.json b/package.json index 5cec1b4..967aeb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redirectcheck", - "version": "0.1.3.rc", + "version": "0.1.4.rc", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 5103638..de86b95 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -1,7 +1,7 @@ import { appConfig, type LocaleType } from "@/config"; import getRequestConfig from "@/i18n"; -import { cn, createAlternates, getCanonical } from "@/lib/utils"; +import { cn, createAlternates } from "@/lib/utils"; import { GoogleAnalytics } from '@next/third-parties/google'; import type { Metadata } from "next"; import { NextIntlClientProvider } from "next-intl"; @@ -29,10 +29,7 @@ export async function generateMetadata(locale: LocaleType): Promise { template: `%s - ${appConfig.appRootDomain}`, }, description: t('frontend.meta.default.description'), - alternates: createAlternates({ - canonical: getCanonical({headers: headersList}), - headers: headersList - }) + alternates: createAlternates({ headers: headersList }) }; } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 2bcf991..3f1d8f8 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -19,7 +19,7 @@ export const getCanonical = ({ headers }: { headers: Headers }) => { return `${origin}${url.pathname}`; } -export const createAlternates = ({ headers, canonical }: { headers: Headers; canonical: string; }) => { +export const createAlternates = ({ headers }: { headers: Headers; }) => { let languages = {} as Record; const linkStr = headers.get("Link")!; const links = linkStr.split(','); @@ -35,7 +35,7 @@ export const createAlternates = ({ headers, canonical }: { headers: Headers; can }) return { - canonical, + canonical: getCanonical({ headers }), languages } } \ No newline at end of file