From 78e3e234877cb10ca1088df31e831b36fa4a12c0 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 23 Jan 2026 23:16:45 +0800 Subject: HALF WORK! --- www-2/src/content.config.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 www-2/src/content.config.ts (limited to 'www-2/src/content.config.ts') diff --git a/www-2/src/content.config.ts b/www-2/src/content.config.ts new file mode 100644 index 0000000..f309aa5 --- /dev/null +++ b/www-2/src/content.config.ts @@ -0,0 +1,17 @@ +import { defineCollection } from "astro:content"; +import { glob } from "astro/loaders"; +import { z } from "astro/zod"; + +const blogs = defineCollection({ + loader: glob({ pattern: "**/*.md", base: "./content" }), + schema: z.object({ + title: z.string(), + description: z.string().optional(), + date: z.coerce.date(), + lastmod: z.coerce.date().optional(), + categories: z.string().optional(), + tags: z.array(z.string()).optional(), + }), +}); + +export const collections = { blogs }; -- cgit v1.2.3