mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
feat: use new og images in layout
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user