|
| 1 | +{{- $pctx := . -}} |
| 2 | +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} |
| 3 | +{{- $pages := slice -}} |
| 4 | +{{- $sectionsToInclude := (slice "blog" "workshops") -}} |
| 5 | +{{- $typesToInclude := (slice "student-talks" "hacking-hours") -}} |
| 6 | + |
| 7 | +{{- range $pctx.RegularPages -}} |
| 8 | + {{- if and .Date (not .Date.IsZero) (or (in $sectionsToInclude .Section) (in $typesToInclude .Type)) (ne .Params.upcoming true) -}} |
| 9 | + {{- $pages = $pages | append . -}} |
| 10 | + {{- end -}} |
| 11 | +{{- end -}} |
| 12 | + |
| 13 | +{{- $limit := .Site.Config.Services.RSS.Limit | default 20 -}} |
| 14 | +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} |
| 15 | +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| 16 | + <channel> |
| 17 | + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> |
| 18 | + <link>{{ .Permalink }}</link> |
| 19 | + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description> |
| 20 | + <generator>Hugo</generator> |
| 21 | + <language>{{ site.Language.LanguageCode | default "en-us" }}</language> |
| 22 | + {{ with .Site.Lastmod -}} |
| 23 | + <lastBuildDate>{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate> |
| 24 | + {{- end -}} |
| 25 | + {{- with .OutputFormats.Get "RSS" -}} |
| 26 | + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} |
| 27 | + {{- end -}} |
| 28 | + {{- range first $limit (sort $pages "Date" "desc") -}} |
| 29 | + <item> |
| 30 | + <title>{{ .Title }}</title> |
| 31 | + <link>{{ .Permalink }}</link> |
| 32 | + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> |
| 33 | + <guid>{{ .Permalink }}</guid> |
| 34 | + <description>{{ .Description }}</description> |
| 35 | + </item> |
| 36 | + {{- end -}} |
| 37 | + </channel> |
| 38 | +</rss> |
0 commit comments