import { defineCollection, z } from 'astro:content';

const blog = defineCollection({
  type: 'content',
  schema: z.object({
    title: z.string(),
    description: z.string(),
    pubDate: z.coerce.date(),
    updatedDate: z.coerce.date().optional(),
    heroImage: z.string().optional(),
    category: z.enum(['Web Development', 'Mobile Apps', 'AI/ML', 'Cloud', 'DevOps', 'Security']),
    tags: z.array(z.string()),
    author: z.object({
      name: z.string(),
      avatar: z.string().optional(),
    }),
    draft: z.boolean().default(false),
  }),
});

export const collections = { blog };
