Files
blog/src/content.config.ts
T
2026-03-30 18:29:50 +02:00

20 lines
496 B
TypeScript

import { defineCollection, z } from "astro:content";
import { glob } from "astro/loaders";
const blog = defineCollection({
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/blog" }),
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string(),
image: image(),
publishDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
tags: z.array(z.string()).optional(),
}),
});
export const collections = {
blog,
};