From 45026eee4c93bbbe6141dd23a664abe6e9ff3ca2 Mon Sep 17 00:00:00 2001 From: nolawz Date: Tue, 3 Mar 2026 04:04:23 +0530 Subject: Added events section and components required for that --- src/content.config.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/content.config.ts') diff --git a/src/content.config.ts b/src/content.config.ts index ed8186c..1c01708 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -1,6 +1,20 @@ import { glob } from 'astro/loaders' import { defineCollection, z } from 'astro:content' +const events = defineCollection({ + loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/events' }), + schema: ({ image }) => + z.object({ + title: z.string(), + description: z.string(), + date: z.coerce.date(), + order: z.number().optional(), + image: image().optional(), + type: z.string().optional(), + draft: z.boolean().optional(), + }), +}) + const blog = defineCollection({ loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }), schema: ({ image }) => @@ -46,4 +60,4 @@ const projects = defineCollection({ }), }) -export const collections = { blog, authors, projects } +export const collections = { events, blog, authors, projects } -- cgit v1.2.3