106 lines
4.1 KiB
XML
106 lines
4.1 KiB
XML
{{- if or (.IsHome) (in .Site.Params.mainMenu .Section) -}}
|
|
{{- $title := .Site.Title -}}
|
|
{{- $desc := "" -}}
|
|
{{- $i18n_section := i18n "news" -}}
|
|
|
|
{{- if .IsHome -}}
|
|
{{- $desc = printf "Aktuelle Informationen vom %s" $title -}}
|
|
{{- $title = printf "%s: %s" $title $i18n_section -}}
|
|
{{ else if in .Site.Params.mainMenu .Section }}
|
|
{{- $desc = printf "Aktuelle Informationen vom %s" .Site.Title -}}
|
|
{{ $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 -}}
|
|
{{- if eq .Section "events" -}}
|
|
{{- $pages = where $pages ".Params.when" "ne" nil -}}
|
|
{{- end -}}
|
|
|
|
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
<channel>
|
|
<title>{{ $title }}</title>
|
|
<link>{{ .Permalink }}</link>
|
|
<description>{{- $desc -}}</description>
|
|
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
|
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
|
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
|
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
|
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
|
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
|
{{- with .OutputFormats.Get "RSS" -}}
|
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .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 }}
|
|
|
|
<item>
|
|
<title>{{ .Title }}</title>
|
|
<link>{{ .Permalink }}</link>
|
|
<pubDate>{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
|
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
|
<guid>{{ .Permalink }}-{{ $hash }}</guid>
|
|
<description>
|
|
{{- $c := .Content -}}
|
|
|
|
{{- $summary := "" -}}
|
|
{{- if in .RawContent "<!--more-->" -}}
|
|
{{- $tmp := split .RawContent "<!--more-->" -}}
|
|
{{- $c = index $tmp 0 | markdownify -}}
|
|
{{- else if $c -}}
|
|
{{- if hasPrefix .Summary "<p>" -}}
|
|
{{- $c = .Summary -}}
|
|
{{- else -}}
|
|
{{- $c = printf "<p>%s</p>" .Summary -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- if $when -}}
|
|
{{- $c = printf "<p><b>%s</b></p>%s" $when $c -}}
|
|
{{- end -}}
|
|
{{- $banner := .Resources.GetMatch "banner*" -}}
|
|
{{- if $banner -}}
|
|
{{- $c = printf "<img src=\"%s\" width=\"%d\" height=\"%d\" />%s" $banner.Permalink $banner.Width $banner.Height $c -}}
|
|
{{- end -}}
|
|
|
|
{{- range .Resources.ByType "image" -}}
|
|
{{- if not (hasPrefix . "banner") }}
|
|
{{- $c = printf "%s<img src=\"%s\" width=\"%d\" height=\"%d\" />" $c .Permalink .Width .Height -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- printf "<![CDATA[%s]]>" ($c | safeHTML) -}}
|
|
{{- end -}}
|
|
</description>
|
|
|
|
</item>
|
|
{{ end }}
|
|
</channel>
|
|
</rss>
|
|
{{- end -}}
|