mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:01:42 +08:00
chore: add content collections configuration
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { z, defineCollection } from "astro:content";
|
||||
|
||||
const blogCollection = defineCollection({
|
||||
schema: z.object({
|
||||
author: z.string(),
|
||||
datetime: z.string(), // z.string().datetime() only available in Zod v3.20.2
|
||||
title: z.string(),
|
||||
slug: z.string().optional(),
|
||||
featured: z.boolean(),
|
||||
draft: z.boolean(),
|
||||
tags: z.array(z.string()),
|
||||
ogImage: z.string().optional(),
|
||||
description: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
blog: blogCollection,
|
||||
};
|
||||
Reference in New Issue
Block a user