blob: 667a31cc739122baa8ee5b795b6b346a206c0fb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { defineCollection, z } from 'astro:content';
const blog = 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(),
heroImage: z.string().optional(),
}),
});
export const collections = { blog };
|