20 lines
No EOL
425 B
TypeScript
20 lines
No EOL
425 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: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
pubDate: z.coerce.date(),
|
|
tags: z.array(z.string()).default([]),
|
|
draft: z.boolean().default(false),
|
|
}),
|
|
});
|
|
|
|
export const collections = {
|
|
blog,
|
|
}; |