You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
934 B
34 lines
934 B
import { z, defineCollection } from "astro:content";
|
|
|
|
const blog = defineCollection({
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
wip: z.boolean().optional().default(false),
|
|
pubDate: z.string().transform((dateStr) => new Date(dateStr)),
|
|
}),
|
|
});
|
|
|
|
const fanfic = defineCollection({
|
|
schema: z.object({
|
|
title: z.string(),
|
|
// description and tags need to be optional because of chapters
|
|
description: z.string().optional(),
|
|
tags: z.array(z.string()).optional(),
|
|
oneshot: z.boolean().optional().default(false),
|
|
wip: z.boolean().optional().default(false),
|
|
|
|
// exclusive to chapters
|
|
parent: z.string().optional(),
|
|
pubDate: z
|
|
.string()
|
|
.transform((dateStr) => new Date(dateStr))
|
|
.optional(),
|
|
}),
|
|
});
|
|
|
|
export const collections = {
|
|
blog: blog,
|
|
fanfic: fanfic,
|
|
};
|