fgo-ta-com-website/src/content/config.ts

34 lines
734 B
TypeScript
Raw Normal View History

2024-01-09 14:30:28 +01:00
import { z, defineCollection } from 'astro:content'
const taEntry = z.object({
title: z.string(),
link: z.string().url(),
date: z.string().transform((str) => new Date(str)),
servant: z.string(),
turns: z.string(),
runner: z.string(),
})
2024-01-09 14:30:28 +01:00
const taInfo = defineCollection({
type: 'data',
schema: z.object({
info: z.object({
title: z.string(),
releaseDate: z.string().transform((str) => new Date(str)),
2024-01-09 14:30:28 +01:00
shortdescription: z.string(),
releaseNumber: z.number().default(1),
2024-01-09 14:30:28 +01:00
}),
quests: z.array(
2024-01-09 14:30:28 +01:00
z.object({
questTitle: z.string(),
description: z.string(),
data: z.array(taEntry)
2024-01-09 14:30:28 +01:00
})
),
}),
})
export const collections = {
taInfoData: taInfo,
}