hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 618948e4a83665f8355b01d8a3f7a7186e6bd3eb
parent c447b7dd6efcb662f177ad0c9037133361ed74e3
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Mon, 25 Jul 2016 23:38:37 +0200

Reset translation slice on rebuild

Also add all translations, including the current, to the slice. We filter later.

Diffstat:
Mhugolib/site.go | 6------
Mhugolib/translations.go | 4+---
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -2048,12 +2048,6 @@ func (s *Site) renderAndWritePage(name string, dest string, d interface{}, layou
 		return err
 	}
 
-	if renderBuffer.Len() == 0 {
-		if p, ok := d.(*Page); ok {
-			fmt.Println(">>>>", p.Lang(), len(p.Content))
-		}
-	}
-
 	outBuffer := bp.GetBuffer()
 	defer bp.PutBuffer(outBuffer)
 
diff --git a/hugolib/translations.go b/hugolib/translations.go
@@ -55,6 +55,7 @@ func pagesToTranslationsMap(ml *Multilingual, pages []*Page) map[string]Translat
 
 func assignTranslationsToPages(allTranslations map[string]Translations, pages []*Page) {
 	for _, page := range pages {
+		page.translations = page.translations[:0]
 		base := page.TranslationBaseName()
 		trans, exist := allTranslations[base]
 		if !exist {
@@ -63,9 +64,6 @@ func assignTranslationsToPages(allTranslations map[string]Translations, pages []
 
 		// TODO(bep) multilingo remove lang
 		for _, translatedPage := range trans {
-			if translatedPage == page {
-				continue
-			}
 			page.translations = append(page.translations, translatedPage)
 		}