优化结构
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user