mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Add Translations and AllTranslations methods to Page
Will revisit Node later.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user