From 74d727d2ea9a5918a8cea8ac8fef411264b9a921 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Fri, 29 Dec 2023 16:58:14 -0700 Subject: [PATCH] Unix: add new content schema for unix --- src/content/config.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 };