lorescape/layouts/podcast/rss.xml

65 lines
3.8 KiB
XML
Raw Normal View History

2020-10-14 21:31:14 +00:00
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ .Site.Params.Podcast.Title | default .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>{{ .Site.Params.Podcast.Description | default .Site.Params.Description }}</description>
<generator>Hugo -- gohugo.io</generator>
<language>{{ .Site.Params.Podcast.Lang | default .Site.LanguageCode }}</language>
{{ 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 -}}
{{ with .Site.Params.Podcast.Image }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
{{ with .Site.Params.Podcast.Category -}}
<itunes:category {{ if .name }}text="{{ .name }}"{{end}}>
{{ range .subcategories }}<itunes:category text="{{ . }}" />{{ end }}
</itunes:category>
{{ end -}}
{{ with .Site.Params.Podcast.Owner -}}
<itunes:owner>
{{ with .name }}<itunes:name>{{ . }}</itunes:name>{{ end }}
{{ with .email }}<itunes:email>{{ . }}</itunes:email>{{ end }}
</itunes:owner>
{{ end -}}
{{ with .Site.Params.Podcast.Description }}<itunes:summary>{{ . }}</itunes:summary>{{ end }}
{{ with .Site.Params.Podcast.Author }}<itunes:author>{{ . }}</itunes:author>{{ end }}
{{ with .Site.Params.Podcast.Type }}<itunes:type>{{ . }}</itunes:type>{{ end }}
{{ with .Site.Params.Podcast.Block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
{{ with .Site.Params.Podcast.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
{{ with .Site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ end }}
<itunes:explicit>{{ if .Site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
{{ range .Pages }}
<item>
<title>{{ .Title }}</title>
<itunes:title>{{ .Title }}</itunes:title>
<link>{{ .Permalink }}</link>
<guid>{{ .Permalink }}</guid>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email -}}
<author>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</author>
{{ end -}}
<description>{{ .Content | html }}</description>
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (add "/static" (. | relURL)) }}<enclosure url="{{ if $.Site.Params.Podcast.cdn }}{{ add $.Site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
{{ with .Params.podcast.duration }}<itunes:duration>{{ . }}</itunes:duration>{{ end }}
{{ with .Params.podcast.image.src }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
{{ with .Params.podcast.episode }}<itunes:episode>{{ . }}</itunes:episode>{{ end }}
{{ with .Params.podcast.episodeType }}<itunes:episodeType>{{ . }}</itunes:episodeType>{{ end }}
{{ with .Params.podcast.season }}<itunes:season>{{ . }}</itunes:season>{{ end }}
{{ with .Params.podcast.block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
<itunes:explicit>{{ if .Params.podcast.explicit }}true{{ else }}false{{ end }}</itunes:explicit>
</item>
{{ end }}
</channel>
</rss>