bunteshaus.de/themes/buha/layouts/_default/list.atom.xml

47 lines
1.8 KiB
XML

{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link href="{{ .Permalink }}index.xml" rel="self"/>
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
<id>{{ .Permalink }}</id>{{ with .Site.Author.name }}
<author>
<name>{{.}}</name>{{ with $.Site.Author.email }}
<email>{{.}}</email>{{end}}
</author>{{end}}
<generator>Hugo -- gohugo.io</generator>{{ range $pages.ByLastmod.Reverse }}
<entry>
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
<link href="{{ .Permalink }}"/>
<id>{{ .Permalink }}</id>{{ with $.Site.Author.name }}
<author>
<name>{{.}}</name>
</author>{{end}}
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ if .Content }}
{{ `<content type="html"><![CDATA[` | safeHTML }}
{{ .Content }}
{{ $c := .Content }}
{{ $alink := .Permalink }}
{{ range .Resources.ByType "image" }}
{{ if and (not (in $c .Name)) (not (in .Name "banner")) }}
<a href="{{ $alink }}" class="article_image no_underline"> <img loading="lazy" src="{{ .Permalink }}" alt="lala" width=780 height="520" /><br> {{ .Name }} </a>
{{ end }}
{{ end }}
]]></content>
{{ end }}
</entry>{{ end }}
</feed>