rss: set pubdate with the last modification date

- Sets the publication date to the last modification date if it exists.

Co-Authored-by: iGor milhit <igor@milhit.ch>
iGor milhit 2024-08-26 08:39:50 +02:00
parent 75086bc831
commit 0ed9fe2a8b
Signed by: igor
GPG Key ID: 692D97C3D0228A99
1 changed files with 4 additions and 0 deletions

View File

@ -29,7 +29,11 @@
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
{{ if (and (isset .Params "lastmod") (gt (dateFormat "2006-01-02" (.Lastmod)) (dateFormat "2006-01-02" (.PublishDate)))) }}
<pubDate>{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ else }}
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ end }}
{{ with .Site.Params.author.email }}<author>{{.}}{{ with $.Site.Params.author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>