From d34d3415c1f6392927fbfb139efddc59db6138f6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 15 Oct 2022 00:32:44 +0100 Subject: [PATCH] feat: re-add events to talk pages --- website/src/pages/talks/[slug].astro | 32 +++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/website/src/pages/talks/[slug].astro b/website/src/pages/talks/[slug].astro index bfe1c543..07b05395 100644 --- a/website/src/pages/talks/[slug].astro +++ b/website/src/pages/talks/[slug].astro @@ -16,8 +16,17 @@ export async function getStaticPaths() { }) } +interface Event { + date: string + location: string + name: string + online?: boolean + time: string + url?: string +} + const { Content } = Astro.props.talk -const { title, speakerdeck, video } = Astro.props.talk.frontmatter +const { events, title, speakerdeck, video }: { events: Event[] } = Astro.props.talk.frontmatter --- @@ -58,5 +67,26 @@ const { title, speakerdeck, video } = Astro.props.talk.frontmatter )} + +
+

Events

+ +
+
    + {events.map((event) => ( +
  • + {event.url ? ({event.name}) : event.name} + {event.location && `in ${event.location}`} + - {new Date(event.date).toLocaleDateString('en-GB', { + day: 'numeric', + month: 'long', + year: 'numeric', + })} + {event.online && '(online)'} +
  • + ))} +
+
+