diff --git a/app/explore/[slug]/page.tsx b/app/explore/[slug]/page.tsx index f145388..6469022 100644 --- a/app/explore/[slug]/page.tsx +++ b/app/explore/[slug]/page.tsx @@ -10,12 +10,14 @@ import { } from "@/utils/notion"; import { decodingSlug } from "@/utils/url"; import { fetchFilterOptions } from "@/lib/repository-metadata"; +import { SITE_CONFIG } from "@/data/config"; interface IProps { params: { slug: string }; } export async function generateMetadata({ params }: IProps): Promise { + const url = SITE_CONFIG.url; const { slug } = params; const title = slug .split("-") @@ -24,6 +26,9 @@ export async function generateMetadata({ params }: IProps): Promise { return { title, + alternates: { + canonical: `${url}/${slug}`, + }, }; } diff --git a/app/layout.tsx b/app/layout.tsx index 3cebb17..73b86a6 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -23,6 +23,9 @@ export const fontMono = Fira_Code({ }); export const metadata: Metadata = { + alternates: { + canonical: SITE_CONFIG.url, + }, title: { default: SITE_CONFIG.name, template: `%s | ${SITE_CONFIG.name}`,