Compare commits

...

2 Commits
0.1.16 ... main

Author SHA1 Message Date
Firq 0afe61add2
Comments
/ checking (push) Successful in 29s Details
2024-01-25 21:23:21 +01:00
Firq 2db950a59d
Split Schema
/ checking (push) Successful in 12s Details
2024-01-25 21:21:45 +01:00
1 changed files with 22 additions and 16 deletions

View File

@ -1,6 +1,7 @@
import { z, defineCollection } from 'astro:content'
const taEntry = z.object({
// Individual TA entries
const entry = z.object({
title: z.string(),
link: z.string().url(),
date: z.string().transform((str) => new Date(str)),
@ -9,25 +10,30 @@ const taEntry = z.object({
runner: z.string(),
})
const taInfo = defineCollection({
// Individual quest info block
const quest = z.object({
questTitle: z.string(),
description: z.string(),
data: z.array(entry)
})
// Basic info block for page
const info = z.object({
title: z.string(),
releaseDate: z.string().transform((str) => new Date(str)),
shortdescription: z.string(),
releaseNumber: z.number().default(1),
})
// Combined ta data collection schema
const taData = defineCollection({
type: 'data',
schema: z.object({
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)
})
),
info: info,
quests: z.array(quest),
}),
})
export const collections = {
taInfoData: taInfo,
taInfoData: taData,
}