mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 19:32:10 -05:00
Set s.Info.LastChange to Lastmod
Set sitemap.xml <lastmod> field to Lastmod. See #733
This commit is contained in:
parent
3882e7ceaf
commit
d0a4645a34
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue