rss.xml 1.8 KB

1234567891011121314151617181920212223242526
  1. {{ `<?xml version="1.0" encoding="utf-8" ?>` | safeHTML }}
  2. {{ with resources.Get "xml/base.temp.xml" | resources.ExecuteAsTemplate "xml/base.xml" . | minify -}}
  3. {{ printf `<?xml-stylesheet type="text/xsl" href=%q ?>` .Permalink | safeHTML }}
  4. {{ end -}}
  5. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  6. <channel>
  7. <title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }}</title>
  8. <link>{{ .Permalink }}</link>
  9. <description>Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }}</description>
  10. <generator>Hugo -- gohugo.io</generator>{{ with site.LanguageCode }}
  11. <language>{{ . }}</language>{{ end }}{{ with site.Author.email }}
  12. <managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with site.Author.email }}
  13. <webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with site.Copyright }}
  14. <copyright>{{ . }}</copyright>{{ end }}{{ with .Date | default nil }}
  15. <lastBuildDate>{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}{{ with .OutputFormats.Get "RSS" }}
  16. {{ printf `<atom:link href=%q rel="self" type=%q />` .Permalink .MediaType | safeHTML }}{{ end }}{{ range where site.RegularPages "Type" "in" site.Params.mainSections }}
  17. <item>
  18. <title>{{ .Title }}</title>
  19. <link>{{ .Permalink }}</link>
  20. <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>{{ with site.Author.email }}
  21. <author>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</author>{{ end }}
  22. <guid>{{ .Permalink }}</guid>
  23. <description>{{ .Content | html }}</description>
  24. </item>{{ end }}
  25. </channel>
  26. </rss>