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

Commit c3436a6

Browse files
authored
update home og (#634)
1 parent 3bb41e8 commit c3436a6

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

public/images/og_home.png

220 KB
Loading

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,19 @@ export async function generateMetadata({
3636
siteName: 'Nitric Docs',
3737
locale: 'en_US',
3838
url: `${BASE_URL}/docs/${doc.slug}`,
39-
images: [
40-
{
41-
url: `${BASE_URL}/docs/og?title=${encodeURIComponent(doc.slug ? title_meta : 'Nitric Docs')}&description=${encodeURIComponent(doc.description || '')}`,
42-
alt: 'Nitric Docs',
43-
},
44-
],
39+
images: !doc.slug // is home page
40+
? [
41+
{
42+
url: `${BASE_URL}/docs/images/og_home.png`,
43+
alt: 'Nitric Docs',
44+
},
45+
]
46+
: [
47+
{
48+
url: `${BASE_URL}/docs/og?title=${encodeURIComponent(title_meta)}&description=${encodeURIComponent(doc.description || '')}`,
49+
alt: 'Nitric Docs',
50+
},
51+
],
4552
}
4653

4754
if (doc.image && doc.image_alt) {

0 commit comments

Comments
 (0)