From 6c6b1bd1035ae68a18bd83faf7ff1297ead60e8c Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Fri, 3 Jun 2022 12:51:52 +0200 Subject: Do not allow modification of date formats that are required by spec --- layouts/_default/list.atom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'layouts/_default/list.atom.xml') diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 75892fd..5da5f25 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -33,7 +33,7 @@ {{ end }}{{ with site.Params.Copyright }}{{ $copyright := replace . "{year}" now.Year }}{{ $copyright = replace $copyright "©" "©" }} {{ $copyright | plainify }}{{ end }} Hugo{{ if not site.LastChange.IsZero }} - {{ site.LastChange.UTC.Format site.Params.dateFormatFeed }}{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }} + {{ site.LastChange.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }} urn:uuid:{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }}{{- range $pages }} {{- $url := .Permalink | absURL }}{{ $uuid := sha1 (.Permalink | absURL) }}{{ $page := . }} @@ -42,8 +42,8 @@ {{ printf `<![CDATA[%s]]>` .Title | safeHTML }}{{ range first 5 (site.RegularPages.Related .) }} {{ end }} - {{ (.PublishDate.Format site.Params.dateFormatFeed) | html }}{{ if ne .Date .Lastmod }} - {{ .Lastmod.UTC.Format site.Params.dateFormatFeed }}{{ end }} + {{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ if ne .Date .Lastmod }} + {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}{{ end }} urn:uuid:{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }} {{ if .Params.author }} {{- $author_type := (printf "%T" .Params.author) }} -- cgit v1.2.3