mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
Optimize the multilanguage build process
Work In Progress! This commit makes a rework of the build and rebuild process to better suit a multi-site setup. This also includes a complete overhaul of the site tests. Previous these were a messy mix that were testing just small parts of the build chain, some of it testing code-paths not even used in "real life". Now all tests that depends on a built site follows the same and real production code path. See #2309 Closes #2211 Closes #477 Closes #1744
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
package hugolib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
// Translations represent the other translations for a given page. The
|
||||
@@ -41,7 +41,10 @@ func pagesToTranslationsMap(ml *Multilingual, pages []*Page) map[string]Translat
|
||||
language := ml.Language(pageLang)
|
||||
|
||||
if language == nil {
|
||||
panic(fmt.Sprintf("Page language not found in multilang setup: %s", pageLang))
|
||||
// TODO(bep) ml
|
||||
// This may or may not be serious. It can be a file named stefano.chiodino.md.
|
||||
jww.WARN.Printf("Page language (if it is that) not found in multilang setup: %s.", pageLang)
|
||||
language = ml.DefaultLang
|
||||
}
|
||||
|
||||
page.language = language
|
||||
|
Reference in New Issue
Block a user