diff options
Diffstat (limited to 'hugolib/sitemap_test.go')
-rw-r--r-- | hugolib/sitemap_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/sitemap_test.go b/hugolib/sitemap_test.go index aba47ae7d..3fb26638c 100644 --- a/hugolib/sitemap_test.go +++ b/hugolib/sitemap_test.go @@ -26,8 +26,8 @@ import ( const sitemapTemplate = `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> {{ range .Data.Pages }} <url> - <loc>{{ .Permalink }}</loc> - <lastmod>{{ safeHTML ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ with .Sitemap.ChangeFreq }} + <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }} + <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }} <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }} <priority>{{ .Sitemap.Priority }}</priority>{{ end }} </url> |