summaryrefslogtreecommitdiff
path: root/src/content/config.ts
blob: 43a44adffe665e2287e2c0672b93e1113878f615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { defineCollection, z } from 'astro:content';

// Define the blog collection schema
const blogCollection = defineCollection({
  type: 'content',
  schema: z.object({
    title: z.string(),
    description: z.string(),
    pubDate: z.date(),
    image: z.string().optional(),
    author: z.string().default('Anonymous'),
    tags: z.array(z.string()).default([]),
  }),
});

// Export the collections
export const collections = {
  'blog': blogCollection,
};