feat: show the socialImage

This commit is contained in:
KazooTTT
2025-01-31 21:36:59 +08:00
parent a7bba4ad0e
commit 4ae2108477
2 changed files with 7 additions and 13 deletions

View File

@ -13,26 +13,20 @@ interface Props {
const {
content: { data, render },
simple = false
simple = false,
socialImage
} = Astro.props
const { remarkPluginFrontmatter } = await render()
console.log('data.date_modified', data.date_modified)
---
<!-- {
{
socialImage && (
<div class='mb-6'>
<img
src={socialImage}
class='rounded-2xl object-cover'
fetchpriority='high'
loading='eager'
/>
<img src={socialImage} class='rounded-2xl object-cover' loading='eager' />
</div>
)
}
-->
}
<div class='flex flex-wrap items-center gap-x-3 gap-y-2'>
<p class='text-xs'>
<FormattedDate date={data.date} /> /{' '}

View File

@ -19,7 +19,7 @@ const {
slug
} = post
const socialImage = ogImage ? ogImage : `/og-image/${slug}.png`
const socialImage = ogImage ? ogImage : undefined
const articleDate = date?.toISOString()
const { headings } = await post.render()
---