Keep trailing slash when baseUrl contains a sub path

Before this commit, .Site.BaseUrl ended up as:

http://mysite.com/ => http://mysite.com/
http://mysite.com/sub/ => http://mysite.com/sub

Now it becomes:

http://mysite.com/ => http://mysite.com/
http://mysite.com/sub/ => http://mysite.com/sub/

Fixed #931
This commit is contained in:
bep
2015-02-28 18:45:02 +01:00
parent 176ce5deab
commit 9d80ecb4d8
3 changed files with 44 additions and 6 deletions

View File

@@ -444,7 +444,7 @@ func (s *Site) initializeSiteInfo() {
}
s.Info = SiteInfo{
BaseUrl: template.URL(helpers.SanitizeUrl(viper.GetString("BaseUrl"))),
BaseUrl: template.URL(helpers.SanitizeUrlKeepTrailingSlash(viper.GetString("BaseUrl"))),
Title: viper.GetString("Title"),
Author: viper.GetStringMap("author"),
LanguageCode: viper.GetString("languagecode"),