From 558275aa98bf27a519534bed3a8554108749f384 Mon Sep 17 00:00:00 2001 From: David Moore Date: Tue, 15 Oct 2024 15:46:16 +1100 Subject: [PATCH] fix root canonical url --- src/app/[[...slug]]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/[[...slug]]/page.tsx b/src/app/[[...slug]]/page.tsx index bb420adff..69a069e64 100644 --- a/src/app/[[...slug]]/page.tsx +++ b/src/app/[[...slug]]/page.tsx @@ -68,7 +68,7 @@ export async function generateMetadata({ card: 'summary_large_image', }, alternates: { - canonical: `${BASE_URL}/docs/${doc.slug}`, + canonical: doc.slug ? `${BASE_URL}/docs/${doc.slug}` : `${BASE_URL}/docs`, }, } }