commit d0a4645a3412438d47ef98b7cf8f77f15a04eae7
parent 3882e7ceaf818e295fdc652377af914bb60faf7f
Author: Juan B. Rodriguez <jbrodriguez@gmail.com>
Date: Thu, 14 May 2015 16:58:14 -0500
Set s.Info.LastChange to Lastmod
Set sitemap.xml <lastmod> field to Lastmod.
See #733
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -697,7 +697,7 @@ func (s *Site) BuildSiteMeta() (err error) {
s.assembleTaxonomies()
s.assembleSections()
- s.Info.LastChange = s.Pages[0].Date
+ s.Info.LastChange = s.Pages[0].Lastmod
return
}
diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go
@@ -73,8 +73,8 @@ func (t *GoHTMLTemplate) EmbedTemplates() {
t.AddInternalTemplate("_default", "sitemap.xml", `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{ range .Data.Pages }}
<url>
- <loc>{{ .Permalink }}</loc>{{ if not .Date.IsZero }}
- <lastmod>{{ safeHTML ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ 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>