commit decd4ca8689167a4094c7ff5881951bdd100e0ce
parent fd6d1e1772e6501a3805f6a1bf9a4b09821b4521
Author: lou woell <lou@repetitions.de>
Date: Mon, 5 Oct 2026 19:28:48 +0200
fix rss feed
Diffstat:
2 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html
@@ -95,12 +95,18 @@
<!-- RSS -->
{{ with .OutputFormats.Get "RSS" -}}
- <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}"/>
+ <link href="{{ .RelPermalink }}"
+ rel="alternate"
+ type="application/rss+xml"
+ title="RSS Feed"/>
{{- end }}
<!-- JSON Feed -->
{{ with .OutputFormats.Get "json" -}}
- <link href="{{ .RelPermalink }}" rel="alternate" type="application/json" title="{{ $.Site.Title }}"/>
+ <link href="{{ .RelPermalink }}"
+ rel="alternate"
+ type="application/json"
+ title="{{ $.Site.Title }}"/>
{{- end }}
{{- partial "ld_schema" . -}}
diff --git a/layouts/rss.xml b/layouts/rss.xml
@@ -2,13 +2,13 @@
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
-{{- $pages = $pctx.RegularPages -}}
+ {{- $pages = $pctx.RegularPages -}}
{{- else -}}
-{{- $pages = $pctx.Pages -}}
+ {{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
-{{- $pages = $pages | first $limit -}}
+ {{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
@@ -16,25 +16,25 @@
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
- <generator>Hugo -- gohugo.io</generator>{{ with .Site.Language.Locale }}
- <language>{{.}}</language>{{end}}{{ with "hi" }}
- <managingEditor>{{.}}{{ with "hiu" }} ({{.}}){{end}}</managingEditor>{{end}}{{ with "hui" }}
- <webMaster>{{.}}{{ with "hu" }} ({{.}}){{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 }}
+ <generator>Hugo -- gohugo.io</generator>
+ <language>{{ .Site.Language.Locale }}</language>
+ <copyright>{{ .Site.Copyright }}</copyright>
+ {{ 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 }}
+ {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
{{ range $pages }}
- <item>
- <title>{{ .Title }}</title>
- <link>{{ .Permalink }}</link>
- <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
- {{ with "hi" }}<author>{{.}}{{ with "hji" }} ({{.}}){{end}}</author>{{end}}
- <guid>{{ .Permalink }}</guid>
- <description>{{ .Summary | html }}</description>
- <content>{{ .Content | html }}</content>
- </item>
+ <item>
+ <title>{{ .Title }}</title>
+ <link>{{ .Permalink }}</link>
+ <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
+ <author>{{ .Params.Author }}</author>
+ <guid>{{ .Permalink }}</guid>
+ <description>{{ .Summary | html }}</description>
+ <content>{{ .Content | html }}</content>
+ </item>
{{ end }}
</channel>
</rss>