{{$style:=resources.Get"xsl/style.xsl"|resources.ExecuteAsTemplate"podcast-style.xsl"(dict"Site".Site"IsPodcast"true)}}{{printf"<?xml-stylesheet type=\"text/xsl\" href=\""|safeHTML}}{{$style.Permalink}}{{printf"\"?>"|safeHTML}}<rssversion="2.0"xmlns:atom="http://www.w3.org/2005/Atom"xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>{{.Site.Title}}</title><link>{{.Permalink}}</link><description>{{$.Site.Params.description}}</description>{{with.Site.LanguageCode}}<language>{{.}}</language>{{end}}<itunes:imagehref="{{.Site.BaseURL}}images/podcast-cover.png"/><itunes:explicit>no</itunes:explicit>{{ifnot.Date.IsZero}}<lastBuildDate>{{.Date.Format"Mon, 02 Jan 2006 15:04:05 -0700"|safeHTML}}</lastBuildDate>{{end}}{{with.OutputFormats.Get"Podcast"}}{{printf"<atom:link href=%q rel=\"self\" type=%q />".Permalink.MediaType|safeHTML}}{{end}}{{range.Site.RegularPages}}{{if.Params.podcast}}<item><title>{{.Title}}</title><link>{{.Permalink}}</link><pubDate>{{.Date.Format"Mon, 02 Jan 2006 15:04:05 -0700"|safeHTML}}</pubDate><guid>{{.Permalink}}</guid><description>{{with.Description}}{{.}}{{else}}{{.Summary|plainify|replaceRE"Listen to this post:\\s*"""|strings.TrimSpace}}{{end}}</description><enclosureurl="{{printf"%saudio/tts/%s.mp3".Site.BaseURL.File.ContentBaseName}}"type="audio/mpeg"/></item>{{end}}{{end}}</channel></rss>
The template gathers all my blog posts, and if they have the podcast flag set in their front matter, creates an entry in the Podcast feed (Subscribe here!)