blob: bb4d8a1325d4adeabdd195106f8a8a55d3e0e6dc [file] [log] [blame]
Samuel Shuert86826b82024-04-27 16:14:20 -04001import { defineCollection, z } from 'astro:content';
2
3const blog = defineCollection({
4 type: 'content',
5 // Type-check frontmatter using a schema
6 schema: z.object({
7 title: z.string(),
8 description: z.string(),
9 // Transform string to Date object
10 pubDate: z.coerce.date(),
11 updatedDate: z.coerce.date().optional(),
Samuel Shuert86826b82024-04-27 16:14:20 -040012 }),
13});
14
15export const collections = { blog };