mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Add a way to merge pages by language
As an example: ```html {{ $pages := .Site.RegularPages | lang.Merge $frSite.RegularPages | lang.Merge $enSite.RegularPages }} ``` Will "fill in the gaps" in the current site with, from left to right, content from the French site, and lastly the English. Fixes #4463
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/markbates/inflect"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
|
||||
@@ -54,16 +53,8 @@ func TestRenderWithInvalidTemplate(t *testing.T) {
|
||||
|
||||
withTemplate := createWithTemplateFromNameValues("missing", templateMissingFunc)
|
||||
|
||||
s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg, WithTemplate: withTemplate}, BuildCfg{})
|
||||
buildSingleSiteExpected(t, true, deps.DepsCfg{Fs: fs, Cfg: cfg, WithTemplate: withTemplate}, BuildCfg{})
|
||||
|
||||
errCount := s.Log.LogCountForLevelsGreaterThanorEqualTo(jww.LevelError)
|
||||
|
||||
// TODO(bep) clean up the template error handling
|
||||
// The template errors are stored in a slice etc. so we get 4 log entries
|
||||
// When we should get only 1
|
||||
if errCount == 0 {
|
||||
t.Fatalf("Expecting the template to log 1 ERROR, got %d", errCount)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDraftAndFutureRender(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user