mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-16 15:31:21 +08:00
feat: 显示更新时间
This commit is contained in:
@ -13,8 +13,7 @@ interface Props {
|
||||
|
||||
const {
|
||||
content: { data, render },
|
||||
simple = false,
|
||||
socialImage
|
||||
simple = false
|
||||
} = Astro.props
|
||||
const { remarkPluginFrontmatter } = await render()
|
||||
---
|
||||
@ -30,10 +29,8 @@ const { remarkPluginFrontmatter } = await render()
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
} -->{
|
||||
data.draft ? <span class='text-red-500'>(Draft)</span> : null
|
||||
}
|
||||
|
||||
}
|
||||
-->
|
||||
<div class='flex flex-wrap items-center gap-x-3 gap-y-2'>
|
||||
<p class='text-xs'>
|
||||
<FormattedDate date={data.date} /> /{' '}
|
||||
@ -49,6 +46,11 @@ const { remarkPluginFrontmatter } = await render()
|
||||
>
|
||||
<Icon name='category' slot='icon' />
|
||||
</Label>
|
||||
{data.date_modified ? (
|
||||
<Label title='最新更新' as='div'>
|
||||
<FormattedDate date={data.date_modified} />
|
||||
</Label>
|
||||
) : null}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -24,7 +24,9 @@ const post = defineCollection({
|
||||
category: z.string().optional().nullable(),
|
||||
finished: z.boolean().default(false),
|
||||
pinned: z.boolean().default(false),
|
||||
projectUrl: z.string().optional()
|
||||
projectUrl: z.string().optional(),
|
||||
date_created: z.date().optional(),
|
||||
date_modified: z.date().optional()
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user