jk.nipponalba.scot website https://jk.nipponalba.scot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

50 lines
2.5 KiB

  1. {{- $pctx := . -}}
  2. {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
  3. {{- $pages := slice -}}
  4. {{- if or $.IsHome $.IsSection -}}
  5. {{- $pages = $pctx.RegularPages -}}
  6. {{- else -}}
  7. {{- $pages = $pctx.Pages -}}
  8. {{- end -}}
  9. {{- $limit := .Site.Config.Services.RSS.Limit -}}
  10. {{- if ge $limit 1 -}}
  11. {{- $pages = $pages | first $limit -}}
  12. {{- end -}}
  13. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  14. <channel>
  15. <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
  16. <link>{{ .Permalink }}</link>
  17. <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
  18. <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
  19. <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
  20. <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
  21. <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
  22. <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
  23. <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
  24. {{ with .OutputFormats.Get "RSS" }}
  25. {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
  26. {{ end }}
  27. {{ range $pages}}
  28. <item>
  29. <title>{{ .Title }}</title>
  30. <link>{{ .Permalink }}</link>
  31. {{ if eq .Params.posttype "in-reply-to" }}<link>{{ index .Params "in-reply-to" }}</link>{{ end }}
  32. {{ if eq .Params.posttype "like-of" }}<link>{{ index .Params "like-of" }}</link>{{ end }}
  33. {{ if eq .Params.posttype "repost-of" }}<link>{{ index .Params "repost-of" }}</link>{{ end }}
  34. <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
  35. {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
  36. <guid>{{ .Permalink }}</guid>
  37. <description>
  38. {{ .Content | plainify }}
  39. {{ range .Params.Photo }}
  40. {{ if not ( in . "http" ) }}
  41. <media:content xmlns:media="http://search.yahoo.com/mrss" url="https://jk.nipponalba.scot{{.}}" medium="image" type="image/jpeg"/>
  42. {{ else }}
  43. <media:content xmlns:media="http://search.yahoo.com/mrss" url="{{.}}" medium="image" type="image/jpeg"/>
  44. {{ end }}
  45. {{ end }}
  46. </description>
  47. </item>
  48. {{ end }}
  49. </channel>
  50. </rss>