Updates
This commit is contained in:
@@ -18,17 +18,19 @@
|
||||
*/
|
||||
|
||||
// @ts-ignore
|
||||
import {defineCollection, reference, z} from 'astro:content';
|
||||
import {defineCollection, reference, z} from "astro:content";
|
||||
|
||||
export const pagesSchema = z.object({
|
||||
title: z.string().min(1).max(80),
|
||||
description: z.string().min(1).max(120),
|
||||
german: z.boolean().optional().default(false),
|
||||
image: z.string().optional()
|
||||
});
|
||||
|
||||
export const pages = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
title: z.string().min(1).max(80),
|
||||
description: z.string().min(1).max(120),
|
||||
german: z.boolean().optional().default(false),
|
||||
image: z.string().optional()
|
||||
})
|
||||
})
|
||||
schema: pagesSchema
|
||||
});
|
||||
|
||||
export const help = defineCollection({
|
||||
type: "content",
|
||||
@@ -36,9 +38,9 @@ export const help = defineCollection({
|
||||
title: z.string().min(1).max(80),
|
||||
description: z.string().min(1).max(120),
|
||||
tags: z.array(z.string()),
|
||||
related: z.array(reference('help')).optional()
|
||||
related: z.array(reference("help")).optional()
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const modes = defineCollection({
|
||||
type: "data",
|
||||
@@ -47,7 +49,7 @@ export const modes = defineCollection({
|
||||
main: z.boolean(),
|
||||
ranked: z.boolean().optional().default(false)
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const downloads = defineCollection({
|
||||
type: "data",
|
||||
@@ -58,14 +60,14 @@ export const downloads = defineCollection({
|
||||
.or(z.record(z.string(), z.string())),
|
||||
sourceUrl: z.string().url().optional(),
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const rules = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
translationKey: z.string(),
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const announcements = defineCollection({
|
||||
type: "content",
|
||||
@@ -77,13 +79,13 @@ export const announcements = defineCollection({
|
||||
created: z.date(),
|
||||
key: z.string()
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
'pages': pages,
|
||||
'help': help,
|
||||
'modes': modes,
|
||||
'rules': rules,
|
||||
'downloads': downloads,
|
||||
'announcements': announcements
|
||||
}
|
||||
"pages": pages,
|
||||
"help": help,
|
||||
"modes": modes,
|
||||
"rules": rules,
|
||||
"downloads": downloads,
|
||||
"announcements": announcements
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user