feat: use new og images in layout

This commit is contained in:
tanishqmanuja
2023-09-20 15:55:32 +05:30
committed by Sat Naing
parent 300d014fd7
commit 88d9343ab5
3 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -19,7 +19,10 @@ const { title, author, description, ogImage, canonicalURL, pubDatetime, tags } =
const { Content } = await post.render();
const ogImageUrl = typeof ogImage === "string" ? ogImage : ogImage?.src;
const ogUrl = new URL(ogImageUrl ?? `${post.slug}.png`, Astro.url.origin).href;
const ogUrl = new URL(
ogImageUrl ?? `/posts/${slugifyStr(title)}.png`,
Astro.url.origin
).href;
---
<Layout