mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-19 05:34:28 +00:00
Reset translation slice on rebuild
Also add all translations, including the current, to the slice. We filter later.
This commit is contained in:
parent
c447b7dd6e
commit
618948e4a8
2 changed files with 1 additions and 9 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue