gmgauthier.com/layouts/podcast/rss.xml

81 lines
4.0 KiB
XML

{{- $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:content="http://purl.org/rss/1.0/modules/content/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} by {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<image>
<url>{{ .Site.BaseURL }}img/avatar.png</url>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} by {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
</image>
<!-- *** ITUNES TAGS *** -->
<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>
<itunes:image href="{{ .Site.BaseURL }}img/avatar.png"/>
<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}}
{{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.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 }}</title>
<category>{{ .Params.series }}</category>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ .Permalink }}</link>
<guid>{{ .Permalink }}</guid>
<itunes:image href="{{.Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}"/>
{{ if isset .Params "enclosure" }}
{{ with .Params.enclosure }}
<enclosure url="{{ $.Site.Params.podcastCdnURL }}{{ . }}" type="audio/mpeg"/>
{{ end }}
{{ end }}
<description>
{{`<![CDATA[ ` | safeHTML }}
{{ if isset .Params "image" }}<p><img src="{{ .Site.Params.podcastCdnURL }}{{ with .Params.image }}{{.}}{{ end }}" width="600" height="338" /></p>{{end}}
{{ .Summary | safeHTML }}
]]>
</description>
<content:encoded>
{{`<![CDATA[ ` | safeHTML }}
{{ if isset .Params "image" }}
{{ $cdnUrl := .Site.Params.podcastCdnUrl }}
<p><img src="{{ $cdnUrl }}{{ with .Params.image }}{{.}}{{ end }}"/></p>
{{end}}
{{ .Content | safeHTML }}
]]>
</content:encoded>
</item>
{{ end }}
</channel>
</rss>