Add _Rose's Binge_ and add gallery post links for previous stories
This commit is contained in:
parent
d01594f456
commit
efcfce1e06
62 changed files with 687 additions and 26 deletions
|
|
@ -16,7 +16,6 @@ export const WEBSITE_LIST = [
|
|||
"itaku",
|
||||
] as const;
|
||||
|
||||
const localUrlRegex = /^((\/?\.\.(?=\/))+|(\.(?=\/)))?\/?[a-z0-9_-]+(\/[a-z0-9_-]+)*\/?$/;
|
||||
const ekaPostUrlRegex = /^(?:https:\/\/)(?:www\.)?aryion\.com\/g4\/view\/([1-9]\d*)\/?$/;
|
||||
const furaffinityPostUrlRegex = /^(?:https:\/\/)(?:www\.)?furaffinity\.net\/view\/([1-9]\d*)\/?$/;
|
||||
const weasylPostUrlRegex =
|
||||
|
|
@ -43,7 +42,7 @@ const mastodonPost = z
|
|||
if (!match) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: `"mastodonPost" contains an invalid URL`,
|
||||
message: `"mastodon" post contains an invalid URL`,
|
||||
});
|
||||
return z.NEVER;
|
||||
}
|
||||
|
|
@ -69,12 +68,12 @@ const storiesCollection = defineCollection({
|
|||
z.object({
|
||||
// Required
|
||||
title: z.string(),
|
||||
pubDate: z.date().transform(adjustDateForUTCOffset).optional(),
|
||||
wordCount: z.number().int().optional(),
|
||||
contentWarning: z.string(),
|
||||
description: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
// Optional
|
||||
pubDate: z.date().transform(adjustDateForUTCOffset).optional(),
|
||||
isDraft: z.boolean().default(false),
|
||||
shortTitle: z.string().optional(),
|
||||
authors: z
|
||||
|
|
@ -114,11 +113,11 @@ const gamesCollection = defineCollection({
|
|||
z.object({
|
||||
// Required
|
||||
title: z.string(),
|
||||
pubDate: z.date().transform(adjustDateForUTCOffset).optional(),
|
||||
contentWarning: z.string(),
|
||||
description: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
// Optional
|
||||
pubDate: z.date().transform(adjustDateForUTCOffset).optional(),
|
||||
isDraft: z.boolean().default(false),
|
||||
authors: z
|
||||
.union([reference("users"), z.array(reference("users"))])
|
||||
|
|
@ -175,7 +174,7 @@ const seriesCollection = defineCollection({
|
|||
schema: z.object({
|
||||
// Required
|
||||
name: z.string(),
|
||||
url: z.string().regex(localUrlRegex, `"url" must be a local URL`),
|
||||
url: z.string().regex(/^(\/[a-z0-9_-]+)*\/?$/, `"url" must be a local URL`),
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue