14 lines
365 B
TypeScript
14 lines
365 B
TypeScript
import { defineCollection, z } from "astro:content";
|
|
import { glob } from "astro/loaders";
|
|
|
|
const blog = defineCollection({
|
|
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content" }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
date: z.coerce.date(),
|
|
draft: z.boolean().optional(),
|
|
}),
|
|
});
|
|
|
|
export const collections = { blog };
|