1 Commits

Author SHA1 Message Date
ec86a0396a fixed multiple slashes in path 2023-03-03 21:01:05 +01:00

View File

@@ -4,6 +4,7 @@ import (
"encoding/xml"
"fmt"
"math"
"path"
)
type ChangeFrequency string
@@ -51,7 +52,7 @@ type SiteMap struct {
func (m *SiteMap) AddURL(url string, lastMod *string, freq *ChangeFrequency, prio *float64) {
m.urls = append(m.urls, &urlXML{
Loc: fmt.Sprintf("https://%s/%s", m.BaseURL, url),
Loc: fmt.Sprintf("https://%s", path.Join(m.BaseURL, url)),
LastMod: lastMod,
ChangeFreq: freq,
Priority: prio,