Skip to content

Commit b2852fe

Browse files
authored
Add YouTube embeds to session pages (#916)
1 parent 95aa94a commit b2852fe

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/content/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const sessions = defineCollection({
8989
start: z.string().nullable(),
9090
end: z.string().nullable(),
9191
website_url: z.string().url(),
92+
youtube_url: z.string().url().nullable(),
9293
sessions_in_parallel: z.array(z.string()).nullable(),
9394
sessions_after: z.array(z.string()).nullable(),
9495
sessions_before: z.array(z.string()).nullable(),

src/pages/session/[slug].astro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Layout from "../../layouts/Layout.astro";
44
import Prose from "../../components/prose/prose.astro";
55
import { Separator } from "../../components/separator/separator";
66
import { formatInTimeZone } from "date-fns-tz";
7+
import { YouTube } from "@astro-community/astro-embed-youtube";
78
89
export async function getStaticPaths() {
910
const sessions = await getCollection("sessions");
@@ -86,6 +87,13 @@ const nextSessionsOrdered = sameRoomNextSession
8687
<Content />
8788
</Prose>
8889

90+
{entry.data.youtube_url && (
91+
<Prose>
92+
<h2>Recording</h2>
93+
<YouTube id={entry.data.youtube_url} />
94+
</Prose>
95+
)}
96+
8997
{entry.data.resources && (
9098
<>
9199
<br />

0 commit comments

Comments
 (0)