master-wiki/config.ts
2023-11-11 18:48:24 -03:00

39 lines
813 B
TypeScript

import { z, defineCollection } from 'astro:content';
// AstroJS collection configuration
const games = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
release: z.coerce.date(),
developers: z.array(z.string()),
genres: z.array(z.string()),
status: z.enum([
'Backlog',
'On Line',
'Playing',
'Played',
'Wishlist',
'Want to Replay',
'Always Playable',
]),
times_played: z.number(),
}),
});
const blog = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
draft: z.boolean().optional(),
tags: z.array(z.string()).optional(),
published_at: z.coerce.date().optional(),
updated_at: z.coerce.date().optional(),
}),
});
export const collections = {
games,
blog,
};