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'
|
import { z, defineCollection } from 'astro:content'
|
||||||
|
|
||||||
const taEntry = z.object({
|
const entry = z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
link: z.string().url(),
|
link: z.string().url(),
|
||||||
date: z.string().transform((str) => new Date(str)),
|
date: z.string().transform((str) => new Date(str)),
|
||||||
|
@ -9,25 +9,27 @@ const taEntry = z.object({
|
||||||
runner: z.string(),
|
runner: z.string(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const taInfo = defineCollection({
|
const quest = z.object({
|
||||||
type: 'data',
|
questTitle: z.string(),
|
||||||
schema: z.object({
|
description: z.string(),
|
||||||
info: z.object({
|
data: z.array(entry)
|
||||||
|
})
|
||||||
|
|
||||||
|
const info = z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
releaseDate: z.string().transform((str) => new Date(str)),
|
releaseDate: z.string().transform((str) => new Date(str)),
|
||||||
shortdescription: z.string(),
|
shortdescription: z.string(),
|
||||||
releaseNumber: z.number().default(1),
|
releaseNumber: z.number().default(1),
|
||||||
}),
|
})
|
||||||
quests: z.array(
|
|
||||||
z.object({
|
const taData = defineCollection({
|
||||||
questTitle: z.string(),
|
type: 'data',
|
||||||
description: z.string(),
|
schema: z.object({
|
||||||
data: z.array(taEntry)
|
info: info,
|
||||||
})
|
quests: z.array(quest),
|
||||||
),
|
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const collections = {
|
export const collections = {
|
||||||
taInfoData: taInfo,
|
taInfoData: taData,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue