Small adjustment to SiteInfo init
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 12 Aug 2016 08:12:01 +0000 (10:12 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 6 Sep 2016 15:32:20 +0000 (18:32 +0300)
After a visual inspection to make (pretty) sure it is correct re multiple languages.

Updates #2309

helpers/language.go
hugolib/site.go

index 99412930838b6a10a813da96eae558d79f95a43b..a64809f9f5ce7f47ea94638dd087c5f2cea5598e 100644 (file)
@@ -83,7 +83,10 @@ func (l *Language) SetParam(k string, v interface{}) {
        l.params[k] = v
 }
 
+func (l *Language) GetBool(key string) bool { return cast.ToBool(l.Get(key)) }
+
 func (l *Language) GetString(key string) string { return cast.ToString(l.Get(key)) }
+
 func (ml *Language) GetStringMap(key string) map[string]interface{} {
        return cast.ToStringMap(ml.Get(key))
 }
index aa89b6929e521afe2f44953f203539f414a58f1b..dd020f75cb3b1d3b7ed8dc38398a0b03cdb523ec 100644 (file)
@@ -909,10 +909,10 @@ func (s *Site) initializeSiteInfo() {
                Languages:                      languages,
                defaultContentLanguageInSubdir: defaultContentInSubDir,
                GoogleAnalytics:                lang.GetString("GoogleAnalytics"),
-               RSSLink:                        permalinkStr(viper.GetString("RSSUri")),
+               RSSLink:                        permalinkStr(lang.GetString("RSSUri")),
                BuildDrafts:                    viper.GetBool("BuildDrafts"),
                canonifyURLs:                   viper.GetBool("CanonifyURLs"),
-               preserveTaxonomyNames:          viper.GetBool("PreserveTaxonomyNames"),
+               preserveTaxonomyNames:          lang.GetBool("PreserveTaxonomyNames"),
                AllPages:                       &s.AllPages,
                Pages:                          &s.Pages,
                rawAllPages:                    &s.rawAllPages,