import { z, defineCollection } from "astro:content"; const articles = defineCollection({ schema: { title: z.string(), subtitle: z.string(), lang: z.enum(["fr", "en"]), slug: z.string(), tags: z.array(z.string()), // An array of strings // Parse pubDate as a browser-standard `Date` object createdAt: z.string().transform((str) => new Date(str)), updatedAt: z .string() .transform((str) => new Date(str)) .optional(), code: z.boolean().optional() || false, }, }); const fragments = defineCollection({ schema: { title: z.string(), subtitle: z.string(), lang: z.enum(["fr", "en"]), slug: z.string(), tags: z.array(z.string()), // An array of strings // Parse pubDate as a browser-standard `Date` object createdAt: z.string().transform((str) => new Date(str)), updatedAt: z .string() .transform((str) => new Date(str)) .optional(), code: z.boolean().optional() || false, }, }); export const collections = { // Don't forget 'quotes' for collection names containing dashes articles, fragments, };