From e435718c4dd6e956dc1748689a6156129650c250 Mon Sep 17 00:00:00 2001 From: "houston[bot]" Date: Sun, 19 Oct 2025 18:30:51 +0200 Subject: Initial commit from Astro --- src/content.config.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/content.config.ts (limited to 'src/content.config.ts') diff --git a/src/content.config.ts b/src/content.config.ts new file mode 100644 index 0000000..ce37c7f --- /dev/null +++ b/src/content.config.ts @@ -0,0 +1,19 @@ +import { defineCollection, z } from 'astro:content'; +import { glob } from 'astro/loaders'; + +const blog = defineCollection({ + // Load Markdown and MDX files in the `src/content/blog/` directory. + loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }), + // Type-check frontmatter using a schema + schema: ({ image }) => + z.object({ + title: z.string(), + description: z.string(), + // Transform string to Date object + pubDate: z.coerce.date(), + updatedDate: z.coerce.date().optional(), + heroImage: image().optional(), + }), +}); + +export const collections = { blog }; -- cgit v1.2.3