Files
blog/src/content/config.ts
2025-11-21 12:26:58 +08:00

18 lines
385 B
TypeScript

import { defineCollection, z } from 'astro:content';
const postsCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
date: z.date(),
summary: z.string(),
tags: z.array(z.string()).optional(),
cover: z.string().optional(),
author: z.string().optional(),
}),
});
export const collections = {
posts: postsCollection,
};