summaryrefslogtreecommitdiffstats
path: root/layouts/_default/list.atom.xml
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2024-04-14 10:04:36 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2024-04-14 11:22:13 +0200
commitaaad4f7b8fdd96573e9c3c3910d8c8a2c418841b (patch)
treea792284fbd546db3f62f1cabeca39bdac2f2ddff /layouts/_default/list.atom.xml
parent0c6aad8d28d9398dc36c70149e221f3af62203cc (diff)
downloadgohugo-theme-ed-aaad4f7b8fdd96573e9c3c3910d8c8a2c418841b.tar.gz
Use .Site.Lastmod if .Site.Hugo.Version greater than or equal to v0.123.0
Diffstat (limited to 'layouts/_default/list.atom.xml')
-rw-r--r--layouts/_default/list.atom.xml6
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml
index eabd899..67ff79b 100644
--- a/layouts/_default/list.atom.xml
+++ b/layouts/_default/list.atom.xml
@@ -14,6 +14,8 @@
{{- $limit := site.Params.feedSize | default 25 -}}
{{- $pages = $pages | first $limit -}}
+{{- $siteLastMod := partial "site-last-mod.html" . -}}
+
{{- safeHTML "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" }}
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="{{ site.LanguageCode }}" xml:base="{{ site.BaseURL }}">
{{ printf `<title type="html"><![CDATA[%s]]></title>` (partial "title.html" .) | safeHTML }}
@@ -32,8 +34,8 @@
{{ with site.Author.email }}<email>{{ . | html }}</email>{{ end }}
</author>{{ end }}{{ with site.Params.Copyright }}{{ $copyright := replace . "{year}" now.Year }}{{ $copyright = replace $copyright "&copy;" "©" }}
<rights>{{ $copyright | plainify }}</rights>{{ end }}
- <generator uri="https://gohugo.io" version="{{ hugo.Version }}">Hugo</generator>{{ if not site.LastChange.IsZero }}
- <updated>{{ site.LastChange.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}</updated>{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }}
+ <generator uri="https://gohugo.io" version="{{ hugo.Version }}">Hugo</generator>{{ if ne $siteLastMod "" }}
+ <updated>{{ $siteLastMod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}</updated>{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }}
<id>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 }}</id>{{- range $pages }}
<entry>
{{- $url := .Permalink | absURL }}{{ $uuid := sha1 (.Permalink | absURL) }}{{ $page := . }}