2024-01-21 13:54:41 +09:00
|
|
|
import { defineCollection, z } from 'astro:content'
|
2023-09-26 14:27:38 +08:00
|
|
|
|
2024-01-21 13:54:41 +09:00
|
|
|
const postsCollection = defineCollection({
|
|
|
|
schema: z.object({
|
|
|
|
title: z.string(),
|
|
|
|
published: z.date(),
|
2024-07-21 15:47:49 +08:00
|
|
|
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(""),
|
2024-01-21 13:54:41 +09:00
|
|
|
}),
|
2023-09-26 14:27:38 +08:00
|
|
|
})
|
|
|
|
export const collections = {
|
2024-01-21 13:54:41 +09:00
|
|
|
posts: postsCollection,
|
|
|
|
}
|