Skip to content

Commit 87d54a1

Browse files
Add Open Graph image support to sample layout
1 parent 9d3c8b3 commit 87d54a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/samples/[slug].astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ export async function getStaticPaths() {
1313
const { sample } = Astro.props;
1414
const { data } = sample;
1515
const { Content } = await render(sample);
16+
const ogImage = data.thumbnails.find(t => t.type === 'image')?.url;
1617
---
1718

18-
<Layout title={data.title} description={data.shortDescription}>
19+
<Layout title={data.title} description={data.shortDescription} image={ogImage}>
1920
<section class="pt-16 pb-24 px-4">
2021
<div class="max-w-4xl mx-auto">
2122

0 commit comments

Comments
 (0)