From 309f4a3c45eae10232379fe56f10a4fc7200b722 Mon Sep 17 00:00:00 2001 From: satnaing Date: Thu, 26 Jan 2023 18:39:58 +0630 Subject: [PATCH] chore: add content collections configuration --- src/content/config.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/content/config.ts diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 0000000..3ad0d8e --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,19 @@ +import { z, defineCollection } from "astro:content"; + +const blogCollection = defineCollection({ + schema: z.object({ + author: z.string(), + datetime: z.string(), // z.string().datetime() only available in Zod v3.20.2 + title: z.string(), + slug: z.string().optional(), + featured: z.boolean(), + draft: z.boolean(), + tags: z.array(z.string()), + ogImage: z.string().optional(), + description: z.string(), + }), +}); + +export const collections = { + blog: blogCollection, +};