1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import { glob } from 'astro/loaders'; import { defineCollection, z } from 'astro:content'; const blog = defineCollection({ loader: glob({ pattern: '**/*.md', base: "src/data/blog" }), schema: z.object({ title: z.string(), metaDescription: z.string(), publishedAt: z.date() }) }); export const collections = { blog };