From 1056fb2885102815569c4f1280fdad5fa645ec17 Mon Sep 17 00:00:00 2001 From: w3cj Date: Thu, 14 Nov 2024 13:45:18 -0700 Subject: [PATCH] feat: add episode structured data --- .../show/[show_number]/[slug]/+layout.svelte | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/routes/(site)/show/[show_number]/[slug]/+layout.svelte b/src/routes/(site)/show/[show_number]/[slug]/+layout.svelte index 5e84ec952..7713af300 100644 --- a/src/routes/(site)/show/[show_number]/[slug]/+layout.svelte +++ b/src/routes/(site)/show/[show_number]/[slug]/+layout.svelte @@ -47,8 +47,31 @@ function variable_svg(node: HTMLElement) { replace_color(node); } + + const showSchema = { + '@context': 'https://schema.org/', + '@type': 'PodcastEpisode', + url: $page.url, + name: show.title, + datePublished: format(show.date, 'yyyy-LL-dd'), + // TODO: add duration once we are saving it + // timeRequired: 'PT37M', + description: show.aiShowNote?.description, + associatedMedia: { + '@type': 'MediaObject', + contentUrl: show.url + }, + partOfSeries: { + '@type': 'PodcastSeries', + name: 'Syntax', + url: 'https://syntax.fm' + } + }; + + {@html ``} +