mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
Allow renaming of sitemap.xml
This commit is contained in:
committed by
Steve Francia
parent
26d23f7f4b
commit
6cdb8109cf
@@ -1541,11 +1541,15 @@ func (s *Site) RenderSitemap() error {
|
||||
if page.Sitemap.Priority == -1 {
|
||||
page.Sitemap.Priority = sitemapDefault.Priority
|
||||
}
|
||||
|
||||
if page.Sitemap.Filename == "" {
|
||||
page.Sitemap.Filename = sitemapDefault.Filename
|
||||
}
|
||||
}
|
||||
|
||||
smLayouts := []string{"sitemap.xml", "_default/sitemap.xml", "_internal/_default/sitemap.xml"}
|
||||
|
||||
if err := s.renderAndWriteXML("sitemap", "sitemap.xml", n, s.appendThemeTemplates(smLayouts)...); err != nil {
|
||||
if err := s.renderAndWriteXML("sitemap", page.Sitemap.Filename, n, s.appendThemeTemplates(smLayouts)...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user