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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user