hugolib: Fix IsTranslated for "old" node types

The new logic for creating Page objects from old node types
didn't include itself in the translation logic, so
`IsTranslated` returned falsely false for sites with only two languages.

The `AllTranslations` method also returned too few pages in that case.

This commit fixes that.

Fixes #2812
This commit is contained in:
Bjørn Erik Pedersen
2016-12-23 09:52:05 +01:00
parent d1b89f5c7c
commit 88b5bbd532
3 changed files with 48 additions and 8 deletions

View File

@@ -180,7 +180,7 @@ func (h *HugoSites) assignMissingTranslations() error {
// Assign translations
for _, t1 := range nodes {
for _, t2 := range nodes {
if t2.isNewTranslation(t1) {
if t1.isNewTranslation(t2) {
t1.translations = append(t1.translations, t2)
}
}