node to page: Fixe index page translation issues

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen
2016-11-21 10:11:34 +01:00
parent aafbd3b4bf
commit 976f8f84bf
4 changed files with 79 additions and 17 deletions

View File

@@ -195,12 +195,19 @@ func (h *HugoSites) assignMissingTranslations() error {
// Assign translations
for _, t1 := range nodes {
for _, t2 := range nodes {
if t2.isTranslation(t1) {
if t2.isNewTranslation(t1) {
t1.translations = append(t1.translations, t2)
}
}
}
}
// Now we can sort the translations.
for _, p := range allPages {
if len(p.translations) > 0 {
pageBy(languagePageSort).Sort(p.translations)
}
}
return nil
}