mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Reset translation slice on rebuild
Also add all translations, including the current, to the slice. We filter later.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user