www.byjp.me/layouts/_default/list.podcast.xml
2025-02-01 10:18:48 +00:00

39 lines
2.5 KiB
XML

{{- $pages := slice -}}
{{- if .IsHome -}}
{{- $pages = where .Site.RegularPages "Type" "not in" (slice "memex" "timeless" "site-infra" "reading-lists" "notes" "likes") -}}
{{- else -}}
{{- $pages = .Pages -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
{{- printf "<?xml-stylesheet href=\"/rss.xsl\" type=\"text/xsl\"?>" | safeHTML }}
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink | absURL }}</link>
<description>Narrations of recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Params.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with $.Site.Params.Author.name }}
<itunes:author>{{.}}<itunes:author>{{ end }}
<itunes:image>{{ "profile-512.jpg" | absURL }}</itunes:image>{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- range $i, $page := $pages -}}
{{- if not .Page.Params.Audio -}}{{ continue }}{{- end -}}
<item>{{ with .Title }}
<title>{{ . }}</title>{{ else }}<title></title>{{ end }}
<link>{{ .Permalink | absURL }}</link>
{{ if .Page.Params.Audio }}<enclosure url="{{ .Permalink | absURL }}{{ .Page.Params.Audio }}" length="{{ (os.Stat (path.Join .File.Dir .Page.Params.Audio)).Size }}" type="audio/mpeg" />{{end}}
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid>{{ .Permalink | absURL }}</guid>
<description>{{- partial "description.txt" . -}}</description>
<itunes:summary>{{- partial "feedpost.html" . | html -}}</itunes:summary>
<content:encoded>{{- partial "feedpost.html" . | html -}}</content:encoded>
{{- range .Params.syndications}}
<dc:relation>{{ . }}</dc:relation>
{{- end }}
</item>
{{ end }}
</channel>
</rss>