diff --git a/themes/buha/layouts/_default/rss.xml b/themes/buha/layouts/_default/rss.xml index cac75ad..394124c 100644 --- a/themes/buha/layouts/_default/rss.xml +++ b/themes/buha/layouts/_default/rss.xml @@ -6,80 +6,86 @@ {{- if .IsHome -}} {{- $desc = printf "Aktuelle Informationen vom %s" $title -}} {{- $title = printf "%s: %s" $title $i18n_section -}} -{{ else if in .Site.Params.mainMenu .Section }} +{{- else if in .Site.Params.mainMenu .Section -}} {{- $desc = printf "Aktuelle Informationen vom %s" .Site.Title -}} - {{ $i18n_section = i18n .Section }} + {{- $i18n_section = i18n .Section -}} {{- $title = printf "%s: %s" .Site.Title $i18n_section -}} {{- end -}} -{{- $pages := where (where site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections -}} +{{- $pages := where .Site.RegularPages "Section" "in" .Site.Params.searchSections -}} {{- if eq .Section "events" -}} {{- $pages = where $pages ".Params.when" "ne" nil -}} +{{- else if eq .Section "about" -}} + {{- $pages = where $pages ".Params.about" "ne" nil -}} +{{- else if eq .Section "featured" -}} + {{- $pages = where $pages ".Params.featured" "ne" nil -}} +{{- else if eq .Section "tags" -}} + {{- $pages = where $pages ".Params.tags" "ne" nil -}} {{- end -}} -{{- printf "" | safeHTML }} +{{- printf "" | safeHTML -}} - {{ .Site.Title }} - {{ .Permalink }} + {{- .Site.Title -}} + {{- .Permalink -}} {{- $desc -}} - Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + Hugo -- gohugo.io{{- with .Site.LanguageCode -}} + {{.}}{{end}}{{- with .Site.Author.email -}} + {{.}}{{- with $.Site.Author.name -}} ({{.}}){{end}}{{end}}{{- with .Site.Author.email -}} + {{.}}{{- with $.Site.Author.name -}} ({{.}}){{end}}{{end}}{{- with .Site.Copyright -}} + {{.}}{{end}}{{- if not .Date.IsZero -}} + {{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}}{{- end -}} {{- with .OutputFormats.Get "RSS" -}} - {{ printf "" .Permalink .MediaType | safeHTML }} + {{- printf "" .Permalink .MediaType | safeHTML -}} {{- end -}} - {{ range $pages }} - {{ if or (eq .Lastmod .Date) (gt .Lastmod (.Date.AddDate 0 0 -1)) }} - {{ $when := .Params.when }} - {{ $about := .Params.about }} - {{ $covid := .Params.covid }} - {{ $contact := .Params.contact }} - {{ $price := .Params.price }} - {{ $featured := .Params.featured }} - {{ $categories := slice }} - {{ range .Params.categories }} - {{ $categories = $categories | append . }} - {{ end }} - {{ $events := slice }} - {{ range .Params.events }} - {{ $events = $events | append . }} - {{ end }} - {{ $tags := slice }} - {{ range .Params.tags }} - {{ $tags = $tags | append . }} - {{ end }} - {{ $images := slice }} - {{ $hash := slice $when $about $categories $events $covid $contact $price $featured $tags .Date .Lastmod .Title .Content }} - {{ $hash = delimit $hash ", " }} - {{ $hash = md5 $hash }} + {{- range $pages -}} + {{- if or (eq .Lastmod .Date) (gt .Lastmod (.Date.AddDate 0 0 -1)) -}} + {{- $when := .Params.when -}} + {{- $about := .Params.about -}} + {{- $covid := .Params.covid -}} + {{- $contact := .Params.contact -}} + {{- $price := .Params.price -}} + {{- $featured := .Params.featured -}} + {{- $categories := slice -}} + {{- range .Params.categories -}} + {{- $categories = $categories | append . -}} + {{- end -}} + {{- $events := slice -}} + {{- range .Params.events -}} + {{- $events = $events | append . -}} + {{- end -}} + {{- $tags := slice -}} + {{- range .Params.tags -}} + {{- $tags = $tags | append . -}} + {{- end -}} + {{- $images := slice -}} + {{- $hash := slice $when $about $categories $events $covid $contact $price $featured $tags .Date .Lastmod .Title .Content -}} + {{- $hash = delimit $hash ", " -}} + {{- $hash = md5 $hash -}} - {{ if .Params.events }} - {{ index .Params.events 0 }}: - {{ else if .Params.recurrent }} - {{ if i18n "recurrent"}} - {{ i18n "recurrent"}}: - {{ else }} - {{ "Recurrent"}}: - {{ end }} - {{ else if .Params.categories }} - {{ if in .Params.categories "Buha" }} + {{- if .Params.events -}} + {{- index .Params.events 0 -}}: + {{- else if .Params.recurrent -}} + {{- if i18n "recurrent"}} + {{- i18n "recurrent"}}: + {{- else -}} + {{- "Recurrent"}}: + {{- end -}} + {{- else if .Params.categories -}} + {{- if in .Params.categories "Buha" -}} In eigener Sache: - {{ end }} - {{ end }} - {{ .Title }} + {{- end -}} + {{- end -}} + {{- .Title -}} - {{ .Permalink }} - {{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }}-{{ $hash }} + {{- .Permalink -}} + {{- .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}} + {{- with .Site.Author.email -}}{{.}}{{- with $.Site.Author.name -}} ({{.}}){{end}}{{end}} + {{- .Permalink -}}-{{- $hash -}} {{- $c := .Content -}} @@ -116,7 +122,7 @@ - {{ end }} + {{- end -}} {{- end -}}