mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
proper BaseUrl handling (if has trailing slash or not)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user