import { defineCollection, defineContentConfig, z } from '@nuxt/content'

export default defineContentConfig({
  collections: {
    book: defineCollection({
      type: 'page',
      source: 'book/**/*.md',
      schema: z.object({
        title: z.string(),
        description: z.string().optional(),
        order: z.number(),
        page: z.number().optional(),
        readingTime: z.string().optional(),
      }),
    }),
    pages: defineCollection({
      type: 'page',
      source: 'pages/**/*.md',
      schema: z.object({
        title: z.string(),
        description: z.string().optional(),
      }),
    }),
  },
})
