This commit is contained in:
parent
58a33025c4
commit
2db950a59d
1 changed files with 18 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
import { z, defineCollection } from 'astro:content'
|
||||
|
||||
const taEntry = z.object({
|
||||
const entry = z.object({
|
||||
title: z.string(),
|
||||
link: z.string().url(),
|
||||
date: z.string().transform((str) => new Date(str)),
|
||||
|
@ -9,25 +9,27 @@ const taEntry = z.object({
|
|||
runner: z.string(),
|
||||
})
|
||||
|
||||
const taInfo = defineCollection({
|
||||
type: 'data',
|
||||
schema: z.object({
|
||||
info: z.object({
|
||||
const quest = z.object({
|
||||
questTitle: z.string(),
|
||||
description: z.string(),
|
||||
data: z.array(entry)
|
||||
})
|
||||
|
||||
const info = z.object({
|
||||
title: z.string(),
|
||||
releaseDate: z.string().transform((str) => new Date(str)),
|
||||
shortdescription: z.string(),
|
||||
releaseNumber: z.number().default(1),
|
||||
}),
|
||||
quests: z.array(
|
||||
z.object({
|
||||
questTitle: z.string(),
|
||||
description: z.string(),
|
||||
data: z.array(taEntry)
|
||||
})
|
||||
),
|
||||
})
|
||||
|
||||
const taData = defineCollection({
|
||||
type: 'data',
|
||||
schema: z.object({
|
||||
info: info,
|
||||
quests: z.array(quest),
|
||||
}),
|
||||
})
|
||||
|
||||
export const collections = {
|
||||
taInfoData: taInfo,
|
||||
taInfoData: taData,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue