import { z } from 'astro/zod';
import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';

const blog = defineCollection({
  loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
  schema: z.object({
    title: z.string(),
    description: z.string(),
    author: z.string().default('Юрист АВ'),
    category: z.string(),
    categoryColor: z.string().default('bg-gold'),
    date: z.date(),
    readTime: z.string(),
    imageUrl: z.string(),
    draft: z.boolean().default(false),
  }),
});

export const collections = { blog };
