Add Translations and AllTranslations methods to Page

Will revisit Node later.
This commit is contained in:
Bjørn Erik Pedersen
2016-07-25 22:22:09 +02:00
parent 06d12ab895
commit c4e7c37055
8 changed files with 136 additions and 29 deletions

View File

@@ -33,6 +33,7 @@ func readMultilingualConfiguration() error {
func toSortedLanguages(l map[string]interface{}) (hugolib.Languages, error) {
langs := make(hugolib.Languages, len(l))
i := 0
for lang, langConf := range l {
langsMap, ok := langConf.(map[string]interface{})
@@ -57,7 +58,8 @@ func toSortedLanguages(l map[string]interface{}) (hugolib.Languages, error) {
language.SetParam(loki, v)
}
langs = append(langs, language)
langs[i] = language
i++
}
sort.Sort(langs)