diff --git a/src/content/config.ts b/src/content/config.ts index 667a31c..e591fc3 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -13,4 +13,16 @@ const blog = defineCollection({ }), }); -export const collections = { blog }; +const unix = defineCollection({ + type: 'content', + // Type-check frontmatter using a schema + schema: z.object({ + title: z.string(), + description: z.string(), + // Transform string to Date object + updateDate: z.coerce.date(), + heroImage: z.string().optional(), + }), +}); + +export const collections = { blog, unix };