blob: 8f6ca9dc195f53eabce8474b85d12a0fec4a18e3 [file] [log] [blame]
Samuel Shuert86826b82024-04-27 16:14:20 -04001import { defineCollection, z } from 'astro:content';
2
Samuel Shuert21af95a2024-04-30 17:49:11 -04003const post = defineCollection({
Samuel Shuert86826b82024-04-27 16:14:20 -04004 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 Shuert21af95a2024-04-30 17:49:11 -040012 pinned: z.coerce.boolean().optional()
Samuel Shuert86826b82024-04-27 16:14:20 -040013 }),
14});
15
Samuel Shuert21af95a2024-04-30 17:49:11 -040016export const collections = { post };