1
0
mirror of https://github.com/docker/docs.git synced 2026-10-23 18:09:02 +03:00

fix: omit zero lastmod dates from sitemap

Generated reference pages without modification dates appeared in the sitemap with lastmod set to 0001-01-01. Only render lastmod when the page has a nonzero date.
This commit is contained in:
David Karlsson
2026-10-20 14:36:06 +00:00
parent 5bd4f66c63
commit d6df16b222

View File

@@ -10,7 +10,9 @@
{{- if ne .Params.sitemap false }}
<url>
<loc>{{ .Permalink}}</loc>
{{- if not .Lastmod.IsZero }}
<lastmod>{{ .Lastmod | time.Format "2006-01-02" }}</lastmod>
{{- end }}
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>