优化结构

This commit is contained in:
2026-06-18 21:44:37 +08:00 Unverified
parent 3051fe2d6a
commit cb244eb983
74 changed files with 94 additions and 144 deletions
+19
View File
@@ -0,0 +1,19 @@
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
const posts = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/posts' }),
schema: z.object({
title: z.any().optional(),
date: z.any().optional(),
abbrlink: z.any().optional(),
tags: z.any().optional(),
categories: z.any().optional(),
summary: z.any().optional(),
description: z.any().optional(),
comments: z.any().optional(),
cover: z.any().optional(),
}).passthrough(),
});
export const collections = { posts };