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 && (