mirror of
https://codeberg.org/JasterV/jaster.xyz.git
synced 2026-04-26 18:10:01 +00:00
Add support for an optional description on posts
This commit is contained in:
parent
24fc48b367
commit
b986ffb4f1
2 changed files with 2 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ const blog = defineCollection({
|
||||||
schema: ({ image }) =>
|
schema: ({ image }) =>
|
||||||
z.object({
|
z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
|
description: z.string().optional(),
|
||||||
pubDate: z.coerce.date(),
|
pubDate: z.coerce.date(),
|
||||||
image: image(),
|
image: image(),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ const sortedPosts = posts.sort(
|
||||||
{post.data.title}
|
{post.data.title}
|
||||||
</a>
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
{post.data.description && <p>{post.data.description}</p>}
|
||||||
</article>
|
</article>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue