aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/multilingual.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2016-08-10 22:46:02 +0200
committerBjørn Erik Pedersen <[email protected]>2016-09-06 18:32:20 +0300
commitd8a256c155d23ad451625fcb292b297d85888c4c (patch)
treeed3e7218c7b819b31dc62bb177baa011cf6c61c9 /hugolib/multilingual.go
parent446e606a098aeacbaaf89a53c7addd33cd888a74 (diff)
downloadhugo-d8a256c155d23ad451625fcb292b297d85888c4c.tar.gz
hugo-d8a256c155d23ad451625fcb292b297d85888c4c.zip
Fix YAML loading of multilingual config
And some other minor fixes from code review. Updates #2309
Diffstat (limited to 'hugolib/multilingual.go')
-rw-r--r--hugolib/multilingual.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/hugolib/multilingual.go b/hugolib/multilingual.go
index c59b3b649..493a8e8a3 100644
--- a/hugolib/multilingual.go
+++ b/hugolib/multilingual.go
@@ -83,10 +83,10 @@ func toSortedLanguages(l map[string]interface{}) (helpers.Languages, error) {
i := 0
for lang, langConf := range l {
- langsMap, ok := langConf.(map[string]interface{})
+ langsMap, err := cast.ToStringMapE(langConf)
- if !ok {
- return nil, fmt.Errorf("Language config is not a map: %v", langsMap)
+ if err != nil {
+ return nil, fmt.Errorf("Language config is not a map: %T", langConf)
}
language := helpers.NewLanguage(lang)