mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -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.assembleSections()
|
||||
s.Info.LastChange = s.Pages[0].Date
|
||||
s.Info.LastChange = s.Pages[0].Lastmod
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue