diff options
author | tdback <tyler@tdback.net> | 2025-01-22 21:35:46 -0500 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2025-01-22 21:36:11 -0500 |
commit | 37f19ea34af4e61e4f2b519e6e232979125b718a (patch) | |
tree | 63c60bfe9e864509354e3b7fe068da1d66d7e395 /layouts | |
parent | 98728ae9065b1ab75801067552530b68aaaca840 (diff) |
fix: cleanup rss layout
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/rss.xml | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index f5116c6..4f1063a 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -5,35 +5,34 @@ {{- $pages = $pages | first $limit -}} {{- end -}} {{- $rssFeedDescription := .Site.Params.rssFeedDescription | default "summary" -}} -{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +{{ 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>{{ .Site.Title }} blog</title> <link>{{ .Permalink }}</link> <description>Recent content on {{ .Site.Title }}.</description> <generator>Hugo</generator> - <language>{{ site.Language.LanguageCode }}</language>{{ 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 }} + <language>{{ site.Language.LanguageCode }}</language> + {{- 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 }} + {{ 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 .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} <guid>{{ .Permalink }}</guid> - {{ if eq $rssFeedDescription "summary"}} + {{- if eq $rssFeedDescription "summary" -}} <description>{{ .Summary | html }}</description> - {{ else if (eq $rssFeedDescription "full")}} + {{ else if (eq $rssFeedDescription "full") }} <description>{{ .Content | html }}</description> - {{ else }} {{ errorf "Error in RSS feed generation %q" .Path }} - {{ end }} + {{ else }} + {{ errorf "Error in RSS feed generation %q" .Path }} + {{- end -}} </item> - {{ end }} + {{- end }} </channel> </rss> |