mirror of
https://github.com/saicaca/fuwari.git
synced 2025-01-31 19:08:06 +08:00
23 lines
664 B
TypeScript
23 lines
664 B
TypeScript
import { defineCollection, z } from 'astro:content'
|
|
|
|
const postsCollection = defineCollection({
|
|
schema: z.object({
|
|
title: z.string(),
|
|
published: z.date(),
|
|
draft: z.boolean().optional().default(false),
|
|
description: z.string().optional().default(''),
|
|
image: z.string().optional().default(''),
|
|
tags: z.array(z.string()).optional().default([]),
|
|
category: z.string().optional().default(''),
|
|
|
|
/* For internal use */
|
|
prevTitle: z.string().default(''),
|
|
prevSlug: z.string().default(''),
|
|
nextTitle: z.string().default(''),
|
|
nextSlug: z.string().default(''),
|
|
}),
|
|
})
|
|
export const collections = {
|
|
posts: postsCollection,
|
|
}
|