diff options
author | dataCobra <datacobra@thinkbot.de> | 2021-03-06 17:21:01 +0300 |
---|---|---|
committer | dataCobra <datacobra@thinkbot.de> | 2021-03-06 17:21:01 +0300 |
commit | 0c90cda3527861708eedd8cc71ba98e9c10ba869 (patch) | |
tree | f983fc0f5bd6c9a1c7cfbc413aad2b4efbd854d0 | |
parent | 63fd22d8539bbeb3258b2bfae476da61486e2ce5 (diff) |
Refactoring of rss.xml
-rw-r--r-- | layouts/_default/rss.xml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index b1a586c..9cf1b48 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -30,26 +30,27 @@ <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} <copyright>{{ . | markdownify | plainify }}</copyright>{{end}}{{ if not .Date.IsZero }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} - {{ with .OutputFormats.Get "RSS" }} + {{- with .OutputFormats.Get "RSS" }} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} - {{ end }} - {{ range $pages }} - {{- if ne .Params.nofeed true -}} + {{- end }} + {{- range $pages }} + {{- if ne .Params.nofeed true }} <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}} + {{- with .Site.Author.email }} + <author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{ end }} <guid>{{ .Permalink }}</guid> <description> - {{ if isset .Params "description" }} - {{ .Description }} - {{ else }} - {{ .Plain | htmlUnescape | safeHTML | truncate 140 }} - {{ end }} + {{- if isset .Params "description" }} + {{ .Description }} + {{- else }} + {{ .Plain | htmlUnescape | safeHTML | truncate 140 }} + {{- end }} </description> </item> - {{ end -}} - {{ end }} + {{- end }} + {{- end }} </channel> </rss> |