summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorDaniel Lang <[email protected]>2017-01-03 08:11:22 -0800
committerBjørn Erik Pedersen <[email protected]>2017-01-03 17:11:22 +0100
commit2127203ae386da117647f619299a0a53b71b3c4d (patch)
tree503d577d54bd2e7b790c6c1b346a99680c2cd24b /examples
parentcb63e87f8dc14361b0ebb7180e4ff6c421036fa4 (diff)
downloadhugo-2127203ae386da117647f619299a0a53b71b3c4d.tar.gz
hugo-2127203ae386da117647f619299a0a53b71b3c4d.zip
Update documentation and test for sitemap template
Diffstat (limited to 'examples')
-rw-r--r--examples/blog/layouts/sitemap.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/blog/layouts/sitemap.xml b/examples/blog/layouts/sitemap.xml
index 8eb623b8b..005824255 100644
--- a/examples/blog/layouts/sitemap.xml
+++ b/examples/blog/layouts/sitemap.xml
@@ -1,8 +1,8 @@
<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>