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

const Posts = defineCollection({
	type: 'content',
	schema: z.object({
		title: z.string(),
		date: z.date(),
		updated: z.date().optional(),
		summary: z.string().optional(),
		cover: z.string().optional(),
		cover_alt: z.string().optional(),
		tags: z.string().optional(),
		draft: z.boolean().optional(),
		toc: z.boolean().optional(),
		narration: z.string().optional(),
		narration_date: z.date().optional(),
	})
})

const Archives = defineCollection({
	type: 'content',
	schema: z.object({
		title: z.string(),
		date: z.date(),
		updated: z.date().optional(),
		summary: z.string().optional(),
		cover: z.string().optional(),
		cover_alt: z.string().optional(),
		tags: z.string().optional(),
		draft: z.boolean().optional(),
		toc: z.boolean().optional(),
	})
})

export const collections = {
	'posts': Posts,
	'archives': Archives
}