22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
import { defineCollection, z } from "astro:content";
|
|
|
|
const blog = defineCollection({
|
|
type: "content",
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string().optional(),
|
|
pubDate: z.coerce.date(),
|
|
updatedDate: z.coerce.date().optional(),
|
|
draft: z.boolean().optional().default(false),
|
|
// Optional if you use hero images in your layout:
|
|
heroImage: z
|
|
.object({
|
|
src: z.string(),
|
|
alt: z.string().optional(),
|
|
})
|
|
.optional(),
|
|
}),
|
|
});
|
|
|
|
export const collections = { blog };
|