proper BaseUrl handling (if has trailing slash or not)

This commit is contained in:
spf13
2013-07-11 22:55:07 -04:00
parent 7a521ad1a1
commit 649560fca2
2 changed files with 14 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ import (
"os"
"path"
"path/filepath"
"strings"
)
// config file items
@@ -65,6 +66,11 @@ func SetupConfig(cfgfile *string, path *string) *Config {
c.Indexes["tag"] = "tags"
c.Indexes["category"] = "categories"
}
if !strings.HasSuffix(c.BaseUrl, "/") {
c.BaseUrl = c.BaseUrl + "/"
}
return &c
}