diff options
Diffstat (limited to 'src/content.config.ts')
| -rw-r--r-- | src/content.config.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/content.config.ts b/src/content.config.ts new file mode 100644 index 0000000..189848c --- /dev/null +++ b/src/content.config.ts @@ -0,0 +1,18 @@ +import { defineCollection } from "astro:content"; +import { glob } from "astro/loaders"; +import { z } from "astro/zod"; + +const blog = defineCollection({ + loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }), + schema: z.object({ + basedOn: z.optional(z.string()), + dateModified: z.coerce.date(), + datePublished: z.coerce.date(), + description: z.string(), + draft: z.optional(z.boolean()), + lang: z.string(), + title: z.string(), + }), +}); + +export const collections = { blog }; |
