Code Cleanup™
This commit is contained in:
@@ -17,19 +17,18 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// @ts-ignore
|
||||
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()
|
||||
image: z.string().optional(),
|
||||
});
|
||||
|
||||
export const pages = defineCollection({
|
||||
type: "content",
|
||||
schema: pagesSchema
|
||||
schema: pagesSchema,
|
||||
});
|
||||
|
||||
export const help = defineCollection({
|
||||
@@ -38,8 +37,8 @@ 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({
|
||||
@@ -47,8 +46,8 @@ export const modes = defineCollection({
|
||||
schema: z.object({
|
||||
translationKey: z.string(),
|
||||
main: z.boolean(),
|
||||
ranked: z.boolean().optional().default(false)
|
||||
})
|
||||
ranked: z.boolean().optional().default(false),
|
||||
}),
|
||||
});
|
||||
|
||||
export const downloads = defineCollection({
|
||||
@@ -59,14 +58,14 @@ export const downloads = defineCollection({
|
||||
url: z.string().url()
|
||||
.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({
|
||||
@@ -77,8 +76,8 @@ export const announcements = defineCollection({
|
||||
image: image().optional(),
|
||||
tags: z.array(z.string()),
|
||||
created: z.date(),
|
||||
key: z.string()
|
||||
})
|
||||
key: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
@@ -87,5 +86,5 @@ export const collections = {
|
||||
"modes": modes,
|
||||
"rules": rules,
|
||||
"downloads": downloads,
|
||||
"announcements": announcements
|
||||
"announcements": announcements,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user