Consolidate published content layouts and fix comments

This commit is contained in:
Bad Manners 2024-08-10 13:07:53 -03:00
parent d529b043c6
commit c38275e2f2
19 changed files with 637 additions and 721 deletions

View file

@ -220,6 +220,7 @@ export type Lang = z.output<typeof lang>;
export type Website = keyof z.input<typeof websiteLinks>;
export type GamePlatform = z.infer<typeof platform>;
export type CopyrightedCharacters = z.infer<typeof copyrightedCharacters>;
export type PublishedContent = z.infer<typeof publishedContent>;
// Content collections
@ -264,6 +265,8 @@ const gamesCollection = defineCollection({
// Optional parameters
thumbnailWidth: z.number().int().optional(),
thumbnailHeight: z.number().int().optional(),
prev: reference("games").nullish(),
next: reference("games").nullish(),
})
.and(publishedContent)
.refine(({ isDraft, description }) => isDraft || description, `Missing "description" for published game`)