15 lines
377 B
TypeScript
15 lines
377 B
TypeScript
import { defineCollection } from "astro:content"
|
|
import { glob } from "astro/loaders"
|
|
import { z } from "astro/zod"
|
|
|
|
const posts = defineCollection({
|
|
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/posts" }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
published: z.coerce.date(),
|
|
}),
|
|
})
|
|
|
|
export const collections = { posts }
|