From 018bbd55924446518a9917383f05a9ff73bcd589 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 25 Nov 2024 08:47:58 +0100 Subject: [PATCH] fix: add canonical URL for blog posts --- app/(root)/blog/[slug]/page.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/(root)/blog/[slug]/page.tsx b/app/(root)/blog/[slug]/page.tsx index 891e63b..a84fc76 100644 --- a/app/(root)/blog/[slug]/page.tsx +++ b/app/(root)/blog/[slug]/page.tsx @@ -70,6 +70,9 @@ export async function generateMetadata(props: { return { title: `${data.title} - SVR.JS`, description: data.smallDescription, + alternates: { + canonical: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/blog/${data.currentSlug}` + }, openGraph: { title: `${data.title} - SVR.JS`, description: data.smallDescription,