diff options
author | spf13 <steve.francia@gmail.com> | 2013-07-11 22:55:07 -0400 |
---|---|---|
committer | spf13 <steve.francia@gmail.com> | 2013-07-11 22:55:07 -0400 |
commit | 649560fca2bcbe7edb48f67404fb4cfe76274d36 (patch) | |
tree | 683e7dd4cba2630f25fbe289b2f19c048658fc5b /hugolib/config.go | |
parent | 7a521ad1a1ac956dc638f1934509220760f9171f (diff) |
proper BaseUrl handling (if has trailing slash or not)
Diffstat (limited to 'hugolib/config.go')
-rw-r--r-- | hugolib/config.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hugolib/config.go b/hugolib/config.go index cb54b7374..983aa254f 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -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 } |