diff --git a/src/components/SpeakersDetail.astro b/src/components/SpeakersDetail.astro index 117d8b68..ea1dc592 100644 --- a/src/components/SpeakersDetail.astro +++ b/src/components/SpeakersDetail.astro @@ -37,17 +37,17 @@ if (!speaker) {
- {speaker.slidesUrl ? ( + {speaker.slides ? ( <>

{t("slides")}

- - {t("slides-link")} - + ) : null}
diff --git a/src/content/_content.ts b/src/content/_content.ts index 38153bd3..2e5caf83 100644 --- a/src/content/_content.ts +++ b/src/content/_content.ts @@ -44,7 +44,12 @@ const eventCollection = defineCollection({ duration: z.array(z.number()), // in minutes language: z.string(), speakers: z.array(reference("speakers")), - slidesUrl: z.string(), + slides: z.array( + z.object({ + url: z.string(), + title: z.string(), + }), + ), }), }); diff --git a/src/data/speaker.ts b/src/data/speaker.ts index ff401d95..a87a5a18 100644 --- a/src/data/speaker.ts +++ b/src/data/speaker.ts @@ -19,7 +19,10 @@ type Speaker = { blog: string; }; imageUrl: string; - slidesUrl: string; + slides: { + title: string; + url: string; + }[]; } & T; type SpeakerCollectionEntry = CollectionEntry<"speakers">; @@ -45,7 +48,7 @@ async function createSpeaker(person: SpeakerCollectionEntry) { blog: person?.data["social.blog"], }, imageUrl: person?.data.imageUrl, - slidesUrl: person?.data.slidesUrl, + slides: person.data.slides, }; return speaker; @@ -88,7 +91,7 @@ export async function getSpeakersWithoutBody() { blog: speaker.data["social.blog"], }, imageUrl: speaker.data.imageUrl, - slidesUrl: speaker?.data.slidesUrl, + slides: speaker?.data.slides, }) satisfies Omit, ), ); diff --git a/src/pages/speaker-slides.astro b/src/pages/speaker-slides.astro new file mode 100644 index 00000000..5c36098f --- /dev/null +++ b/src/pages/speaker-slides.astro @@ -0,0 +1,37 @@ +--- +import { getCollection } from "astro:content"; +import { changeLanguage, t } from "i18next"; +import Heading from "../components/Heading.astro"; +import Section from "../components/Section.astro"; +import Layout from "../layouts/Layout.astro"; + +changeLanguage("en"); + +const speakers = await getCollection("speakers"); +--- + + +
+
+ +
+
+
+ { + speakers.map((speaker) => + speaker.data.slides ? ( +
+

{speaker.data.name}

+
    + {speaker.data.slides.map((slide: any) => ( +
  • + {slide.title} +
  • + ))} +
+
+ ) : null, + ) + } +
+