This commit is contained in:
2025-10-27 00:53:06 +08:00
parent 3db5a0d2e4
commit c7a650cdb7
8 changed files with 300 additions and 0 deletions

17
src/content.config.ts Normal file
View File

@@ -0,0 +1,17 @@
// @ts-ignore
import { defineCollection, z } from 'astro:content';
import { glob, file } from 'astro/loaders'; // 不适用于旧版 API
const docs = defineCollection({
// loader: glob({ pattern: '**/*.md', base: './src/data/blogs' }),
loader: glob({ pattern: '**/[^_]*.md', base: './src/data/docs' }),
schema: z.object({
title: z.string().optional(),
description: z.string().optional(),
// pubDate: z.coerce.date(),
// updatedDate: z.coerce.date().optional(),
}),
});
export const collections = { docs };