Fix URL in multilanguage sitemap index

Fixes #2509
This commit is contained in:
Bjørn Erik Pedersen
2016-09-30 16:24:09 +02:00
parent d30c6a26d1
commit bf0dfa3e2d
2 changed files with 10 additions and 5 deletions

View File

@@ -878,7 +878,12 @@ func (s *SiteInfo) HomeAbsURL() string {
// SitemapAbsURL is a convenience method giving the absolute URL to the sitemap.
func (s *SiteInfo) SitemapAbsURL() string {
sitemapDefault := parseSitemap(viper.GetStringMap("Sitemap"))
return path.Join(s.HomeAbsURL(), sitemapDefault.Filename)
p := s.HomeAbsURL()
if !strings.HasSuffix(p, "/") {
p += "/"
}
p += sitemapDefault.Filename
return p
}
func (s *Site) initializeSiteInfo() {