mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Fix case issue Viper vs Blackfriday config
There are still work to be done in the case department, but that will have to be another day. Fixes #2581 See https://github.com/spf13/viper/issues/261
This commit is contained in:
committed by
GitHub
parent
4d6cd3cb2a
commit
40b1b8f703
@@ -17,7 +17,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -84,6 +83,7 @@ func toSortedLanguages(l map[string]interface{}) (helpers.Languages, error) {
|
||||
|
||||
for lang, langConf := range l {
|
||||
langsMap, err := cast.ToStringMapE(langConf)
|
||||
helpers.ToLowerMap(langsMap)
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Language config is not a map: %T", langConf)
|
||||
@@ -91,8 +91,7 @@ func toSortedLanguages(l map[string]interface{}) (helpers.Languages, error) {
|
||||
|
||||
language := helpers.NewLanguage(lang)
|
||||
|
||||
for k, v := range langsMap {
|
||||
loki := strings.ToLower(k)
|
||||
for loki, v := range langsMap {
|
||||
switch loki {
|
||||
case "title":
|
||||
language.Title = cast.ToString(v)
|
||||
|
Reference in New Issue
Block a user