Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 6d37b9c

Browse files
committed
fix og:url
1 parent f4e7a26 commit 6d37b9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/[[...slug]]/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ export async function generateMetadata({
3232
seoTitle = `${navItem.breadcrumbParentItem.title}: ${title_meta}`
3333
}
3434

35+
const url = doc.slug ? `${BASE_URL}/docs/${doc.slug}` : `${BASE_URL}/docs`
36+
3537
const openGraph: OpenGraph = {
3638
siteName: 'Nitric Docs',
3739
locale: 'en_US',
38-
url: `${BASE_URL}/docs/${doc.slug}`,
40+
url,
3941
images: !doc.slug // is home page
4042
? [
4143
{
@@ -68,7 +70,7 @@ export async function generateMetadata({
6870
card: 'summary_large_image',
6971
},
7072
alternates: {
71-
canonical: doc.slug ? `${BASE_URL}/docs/${doc.slug}` : `${BASE_URL}/docs`,
73+
canonical: url,
7274
},
7375
}
7476
}

0 commit comments

Comments
 (0)