Files
ghall.space/src/content.config.ts
T
2025-11-24 10:22:06 -05:00

16 lines
401 B
TypeScript

import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
const blogCollection = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
schema: z.object({
title: z.string(),
pubDate: z.string().transform((str: string) => new Date(str)),
tags: z.array(z.string()),
}),
});
export const collections = {
blog: blogCollection,
};