gmgauthier.com/layouts/podcast/rss.xml

91 lines
4.6 KiB
XML
Raw Normal View History

2021-12-02 18:44:48 +00:00
{{- $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 }}
2022-01-05 01:17:30 +00:00
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
2021-12-02 18:44:48 +00:00
<channel>
2022-01-05 10:16:02 +00:00
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} by {{ end }}{{ .Site.Title }}{{ end }}</title>
2021-12-02 18:44:48 +00:00
<link>{{ .Permalink }}</link>
<author>{{ .Site.Author.name }}</author>
<email>{{ .Site.Author.email }}</email>
{{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}by {{ .Site.Title }}</description>
2022-01-05 01:17:30 +00:00
<image>
2022-01-06 19:49:43 +00:00
<url>{{ .Site.BaseURL }}img/website-avatar-large.png</url>
2022-01-05 09:58:16 +00:00
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} by {{ end }}{{ .Site.Title }}{{ end }}</title>
2022-01-05 01:17:30 +00:00
<link>{{ .Permalink }}</link>
</image>
<!-- *** ITUNES TAGS *** -->
2022-01-07 22:21:39 +00:00
<itunes:author>{{ .Site.Author.name }}</itunes:author>
2022-01-05 10:40:34 +00:00
<itunes:category text="Society &amp; Culture">
<itunes:category text="Philosophy"/>
</itunes:category>
<itunes:explicit>No</itunes:explicit>
<itunes:type>episodic</itunes:type>
<itunes:summary>Philosophy essays, debates, discussions, and other explorations.</itunes:summary>
2022-01-06 19:49:43 +00:00
<itunes:image href="{{ .Site.BaseURL }}img/website-avatar-large.png"/>
2022-01-05 10:32:10 +00:00
<itunes:owner>
<itunes:name>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} by {{ end }}{{ .Site.Title }}{{ end }}</itunes:name>
<itunes:email>{{ .Site.Params.email }}</itunes:email>
</itunes:owner>
<!-- /// END ITUNES TAGS /// -->
<generator>Hugo -- gohugo.io</generator>
{{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
{{ with .Site.Author.email }}<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}
{{ with .Site.Author.email }}<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
2021-12-02 18:44:48 +00:00
{{- with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<category>{{ .Params.series }}</category>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ .Permalink }}</link>
2022-01-05 10:00:36 +00:00
<guid>{{ .Permalink }}</guid>
2022-01-01 23:45:38 +00:00
2022-01-05 01:17:30 +00:00
<itunes:image href="{{.Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}"/>
2022-01-01 23:45:38 +00:00
{{ if isset .Params "enclosure" }}
{{ $enclosure := .Params.enclosure }}
{{ $scratch := newScratch }}
{{ range $.Site.Data.podcasts.podcasts }}
{{ if eq .filename $enclosure }}
{{ $scratch.Set "filesize" .filesize }}
{{ end }}
{{ end}}
{{ $filesize := $scratch.Get "filesize" }}
<enclosure url="{{ $.Site.Params.podcastCdnURL }}{{ $enclosure }}" type="audio/mpeg" length="{{ $filesize }}"/>
2022-01-01 23:45:38 +00:00
{{ end }}
2021-12-02 18:44:48 +00:00
<description>
{{`<![CDATA[ ` | safeHTML }}
2022-01-05 18:46:35 +00:00
{{ if isset .Params "image" }}<img src="{{ .Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}" width="600" height="338" />{{end}}
2021-12-02 18:44:48 +00:00
{{ .Summary | safeHTML }}
]]>
</description>
<content:encoded>
{{`<![CDATA[ ` | safeHTML }}
{{ if isset .Params "image" }}
{{ $cdnUrl := .Site.Params.podcastCdnUrl }}
2022-01-05 18:46:35 +00:00
<img src="{{ $cdnUrl }}{{ with .Params.image }}{{.}}{{ end }}"/>
{{end}}
{{ .Content | safeHTML }}
]]>
</content:encoded>
2021-12-02 18:44:48 +00:00
</item>
{{ end }}
</channel>
</rss>