rss.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233
  1. {{/* Generate RSS with full page content rather than just summary. */}}
  2. {{- $pages := .Data.Pages -}}
  3. {{- $limit := .Site.Config.Services.RSS.Limit -}}
  4. {{- if ge $limit 1 -}}
  5. {{- $pages = $pages | first $limit -}}
  6. {{- end -}}
  7. {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
  8. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  9. <channel>
  10. <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
  11. <link>{{ .Permalink }}</link>
  12. <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
  13. <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator>{{ with .Site.LanguageCode }}
  14. <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
  15. <managingEditor>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
  16. <webMaster>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
  17. <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
  18. <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
  19. {{ with .OutputFormats.Get "RSS" }}
  20. {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
  21. {{ end }}
  22. {{ range $pages }}
  23. <item>
  24. <title>{{ .Title }}</title>
  25. <link>{{ .Permalink }}</link>
  26. <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
  27. {{ with .Site.Author.email }}<author>{{.}}{{ with site.Author.name }} ({{.}}){{end}}</author>{{end}}
  28. <guid>{{ .Permalink }}</guid>
  29. <description>{{ .Content | html }}</description>
  30. </item>
  31. {{ end }}
  32. </channel>
  33. </rss>