From e1ec4a112907f4aebad56b2b388eceb3969e6e88 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 12 Jun 2026 18:30:42 -0700 Subject: unify microblog --- src/content/config.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/content/config.ts') diff --git a/src/content/config.ts b/src/content/config.ts index b4e86c9..e2c62ca 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -18,4 +18,23 @@ const blog = defineCollection({ }), }); -export const collections = { blog }; +const micro = defineCollection({ + // Type-check frontmatter using a schema + schema: z.object({ + title: z.string(), + description: z.string(), + // Transform string to Date object + pubDate: z + .string() + .or(z.date()) + .transform((val) => new Date(val)), + updatedDate: z + .string() + .optional() + .transform((str) => (str ? new Date(str) : undefined)), + heroImage: z.string().optional(), + }), +}); + + +export const collections = { blog, micro }; -- cgit v1.2.3