From e38e2cec2bfbaea84defc431c4689ea789126f5d Mon Sep 17 00:00:00 2001 From: haetae Date: Tue, 5 Aug 2025 01:59:13 -0400 Subject: [PATCH] holy shit i did it --- src/content/config.ts | 13 ++++++++++++ src/pages/fics/[ficId]/[chapterId].astro | 2 +- src/pages/test.astro | 26 ++++++++++++++++++++++++ src/utils/loader.ts | 8 +++----- 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 src/pages/test.astro diff --git a/src/content/config.ts b/src/content/config.ts index 3af640e..5b5d9d4 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -49,6 +49,7 @@ const chapters = defineCollection({ notes: z.ostring().transform(notes => parser.renderInline(notes ?? "", {})), lastModified: z.coerce.date().optional(), sortOrder: z.number().default(1), + // fic: reference("fics"), }), }); @@ -85,6 +86,18 @@ const test = defineCollection({ } }) ), + schema: z.object({ + title: z.string(), + series: z.union([z.string(), z.array(z.string())]), + publishedAt: z.coerce.date(), + summary: z.string().transform(summary => parser.renderInline(summary, {})), + characters: z.array(z.string()).optional(), + ships: z.ostring(), + tags: z.array(z.string()).optional(), + notes: z.ostring().transform(notes => parser.renderInline(notes ?? "", {})), + lastModified: z.coerce.date().optional(), + chapters: z.array(reference("chapters")).optional(), + }), }); export const collections = { blog, fics, chapters, test }; \ No newline at end of file diff --git a/src/pages/fics/[ficId]/[chapterId].astro b/src/pages/fics/[ficId]/[chapterId].astro index af52eb7..20bc3a8 100644 --- a/src/pages/fics/[ficId]/[chapterId].astro +++ b/src/pages/fics/[ficId]/[chapterId].astro @@ -43,6 +43,7 @@ const links = [ {lastModified} notes={chapter.data.notes} > + {chapter.id} @@ -50,7 +51,6 @@ const links = [ - {chapters.length > 1 && (