57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
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(),
|
|
}),
|
|
});
|
|
|
|
const portafolio = 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(),
|
|
media: z.array(
|
|
z.object({
|
|
type: z.enum(['image', 'video']),
|
|
url: z.string().url(),
|
|
}),
|
|
),
|
|
}),
|
|
});
|
|
|
|
export const collections = {
|
|
games,
|
|
blog,
|
|
portafolio,
|
|
};
|