mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-17 07:51:22 +08:00
feat: 显示更新时间
This commit is contained in:
@ -13,8 +13,7 @@ interface Props {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
content: { data, render },
|
content: { data, render },
|
||||||
simple = false,
|
simple = false
|
||||||
socialImage
|
|
||||||
} = Astro.props
|
} = Astro.props
|
||||||
const { remarkPluginFrontmatter } = await render()
|
const { remarkPluginFrontmatter } = await render()
|
||||||
---
|
---
|
||||||
@ -30,10 +29,8 @@ const { remarkPluginFrontmatter } = await render()
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} -->{
|
}
|
||||||
data.draft ? <span class='text-red-500'>(Draft)</span> : null
|
-->
|
||||||
}
|
|
||||||
|
|
||||||
<div class='flex flex-wrap items-center gap-x-3 gap-y-2'>
|
<div class='flex flex-wrap items-center gap-x-3 gap-y-2'>
|
||||||
<p class='text-xs'>
|
<p class='text-xs'>
|
||||||
<FormattedDate date={data.date} /> /{' '}
|
<FormattedDate date={data.date} /> /{' '}
|
||||||
@ -49,6 +46,11 @@ const { remarkPluginFrontmatter } = await render()
|
|||||||
>
|
>
|
||||||
<Icon name='category' slot='icon' />
|
<Icon name='category' slot='icon' />
|
||||||
</Label>
|
</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(),
|
category: z.string().optional().nullable(),
|
||||||
finished: z.boolean().default(false),
|
finished: z.boolean().default(false),
|
||||||
pinned: 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