mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 18:15:45 +00:00
Set s.Info.LastChange to Lastmod
Set sitemap.xml <lastmod> field to Lastmod. See #733
This commit is contained in:
1 parent
3882e7ceaf
commit
d0a4645a34
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user