shithub: hugo

Download patch

ref: 02b120d1bd6dc7e81a6c81a44621de45a6c9b594
parent: 6809ea1e7c5cb540d6d81ce0a47f3f0f5d761e8e
author: Abdó Roig-Maranges <[email protected]>
date: Sun Feb 19 10:00:18 EST 2017

hugolib: Discard current language based on .Lang()

Otherwise we fail to skip the current language in translations
for paginated pages.

Fixes #2972

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -860,7 +860,7 @@
 func (p *Page) Translations() Pages {
 	translations := make(Pages, 0)
 	for _, t := range p.translations {
-		if t != p {
+		if t.Lang() != p.Lang() {
 			translations = append(translations, t)
 		}
 	}