Set s.Info.LastChange to Lastmod

Set sitemap.xml <lastmod> field to Lastmod.

See #733
This commit is contained in:
Juan B. Rodriguez 2015-05-14 16:58:14 -05:00 committed by bep
parent 3882e7ceaf
commit d0a4645a34
2 changed files with 3 additions and 3 deletions

View file

@ -697,7 +697,7 @@ func (s *Site) BuildSiteMeta() (err error) {
s.assembleTaxonomies() s.assembleTaxonomies()
s.assembleSections() s.assembleSections()
s.Info.LastChange = s.Pages[0].Date s.Info.LastChange = s.Pages[0].Lastmod
return return
} }

View file

@ -73,8 +73,8 @@ func (t *GoHTMLTemplate) EmbedTemplates() {
t.AddInternalTemplate("_default", "sitemap.xml", `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> t.AddInternalTemplate("_default", "sitemap.xml", `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{ range .Data.Pages }} {{ range .Data.Pages }}
<url> <url>
<loc>{{ .Permalink }}</loc>{{ if not .Date.IsZero }} <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Date.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }} <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 }} <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }} <priority>{{ .Sitemap.Priority }}</priority>{{ end }}
</url> </url>