Add Mastodon comments and remove date-fns dependency

This commit is contained in:
Bad Manners 2024-03-27 11:54:18 -03:00
parent 00fa1fb164
commit 3e8bcbcf43
19 changed files with 393 additions and 142 deletions

View file

@ -20,6 +20,11 @@ const localUrlRegex = /^((\/?\.\.(?=\/))+|(\.(?=\/)))?\/?[a-z0-9_-]+(\/[a-z0-9_-
const lang = z.enum(["eng", "tok"]).default("eng");
const website = z.enum(WEBSITE_LIST);
const mastodonPost = z.object({
instance: z.string(),
user: z.string(),
postId: z.string(),
});
export type Lang = z.output<typeof lang>;
export type Website = z.infer<typeof website>;
@ -53,6 +58,7 @@ const storiesCollection = defineCollection({
next: reference("stories").nullish(),
relatedStories: z.array(reference("stories")).default([]),
relatedGames: z.array(reference("games")).default([]),
mastodonPost: mastodonPost.optional(),
}),
});
@ -78,6 +84,7 @@ const gamesCollection = defineCollection({
lang,
relatedStories: z.array(reference("stories")).default([]),
relatedGames: z.array(reference("games")).default([]),
mastodonPost: mastodonPost.optional(),
}),
});