Improvements to a11y and scripts

This commit is contained in:
Bad Manners 2024-08-18 22:52:45 -03:00
parent a335aff2d3
commit d022fab5d6
17 changed files with 384 additions and 214 deletions

View file

@ -133,7 +133,7 @@ const userList = z
const copyrightedCharacters = z
.record(z.string(), reference("users"))
.refine(
(value) => !("" in value) || Object.keys(value).length == 1,
(value) => !("" in value) || Object.keys(value).length === 1,
`"copyrightedCharacters" cannot mix empty catch-all key with other keys`,
)
.default({});
@ -145,7 +145,7 @@ const publishedContent = z.object({
title: z.string(),
authors: userList,
contentWarning: z.string().trim(),
// Required parameters, but optional for drafts (isDraft == true)
// Required parameters, but optional for drafts (isDraft === true)
pubDate: z
.date()
.transform((date: Date) => new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0))
@ -230,7 +230,7 @@ const storiesCollection = defineCollection({
schema: ({ image }) =>
z
.object({
// Required parameters, but optional for drafts (isDraft == true)
// Required parameters, but optional for drafts (isDraft === true)
wordCount: z.number().int().optional(),
thumbnail: image().optional(),
// Optional parameters
@ -260,7 +260,7 @@ const gamesCollection = defineCollection({
schema: ({ image }) =>
z
.object({
// Required parameters, but optional for drafts (isDraft == true)
// Required parameters, but optional for drafts (isDraft === true)
platforms: z.array(platform).default([]),
thumbnail: image().optional(),
// Optional parameters