pitchandplay/layouts/index.podcast.xml
2025-08-12 01:09:15 -04:00

96 lines
3.8 KiB
XML

{{- $authorEmail := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .email }}
{{- $authorEmail = . }}
{{- end }}
{{- end }}
{{- end }}
{{- $authorName := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .name }}
{{- $authorName = . }}
{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- end }}
{{- $pctx := . }}
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
{{- $pages := slice }}
{{- if or $.IsHome $.IsSection }}
{{- $pages = $pctx.RegularPages }}
{{- else }}
{{- $pages = $pctx.Pages }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit }}
{{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }}
{{- end }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:podcast="https://podcastindex.org/namespace/1.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Pitch and Play</title>
<link>{{ .Permalink }}</link>
<description>A podcast about actually playing the games your friends recommend.</description>
<generator>Hugo</generator>
<language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
<!-- hello? -->
<itunes:author>Pitch and Play</itunes:author>
<itunes:type>episodic</itunes:type>
<itunes:image href="https://pitchandplay.org/cover.png" />
<image>
<url>https://pitchandplay.org/cover.png</url>
</image>
<itunes:category text="Leisure">
<itunes:category text="Video Games"/>
</itunes:category>
<itunes:explicit>true</itunes:explicit>
<atom:link
href="{{ .Permalink }}feed.xml"
rel="self"
type="application/rss+xml" />
<lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
<item>
<title>{{ .Title | transform.XMLEscape | safeHTML }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>PPEpisode{{ .Params.episodeNumber }}</guid>
<description>{{ .Content | transform.XMLEscape | safeHTML }}</description>
<itunes:title>{{ .Title | transform.XMLEscape | safeHTML }}</itunes:title>
<itunes:episodeType>{{ .Params.episodeType }}</itunes:episodeType>
<content:encoded>{{ .Content | transform.XMLEscape | safeHTML }}</content:encoded>
<itunes:subtitle>{{ .Summary | transform.XMLEscape | safeHTML }}</itunes:subtitle>
<enclosure length="{{ .Params.episodeLength }}" type="audio/mpeg" url="{{ .Params.episodeURL }}" />
<itunes:duration>{{ .Params.episodeDuration }}</itunes:duration>
<itunes:explicit>{{ .Params.episodeExplicit }}</itunes:explicit>
<itunes:episode>{{ .Params.episodeNumber }}</itunes:episode>
<itunes:season>{{ .Params.episodeSeason }}</itunes:season>
{{ if eq .Params.episodeChapters false }}
{{ else }}
<podcast:chapters url="{{ .Permalink }}chapters.json" type="application/json+chapters" />
{{ end }}
{{ if eq .Params.episodeTranscript false }}
{{ else }}
<podcast:transcript url="{{ .Permalink }}transcript.vtt" type="text/vtt" />
{{ end }}
</item>
{{- end }}
</channel>
</rss>