blob: 8f6ca9dc195f53eabce8474b85d12a0fec4a18e3 [file] [log] [blame]
import { defineCollection, z } from 'astro:content';
const post = defineCollection({
type: 'content',
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
description: z.string(),
// Transform string to Date object
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
pinned: z.coerce.boolean().optional()
}),
});
export const collections = { post };