Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-03-15 11:37:30 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-03-16 12:10:01 +0300
commitffaec4ca8c4c6fd05b195879ccd65acf2fd5a6ac (patch)
tree28d4a68d5b41d5ccd769208856d0e3b4f086ebe5 /hugolib/hugo_sites_build.go
parent91fb8f1b59cce50de914d66dac1d406655c3c43b (diff)
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
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r--hugolib/hugo_sites_build.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go
index c8affe15a..1c4ee7b63 100644
--- a/hugolib/hugo_sites_build.go
+++ b/hugolib/hugo_sites_build.go
@@ -15,9 +15,12 @@ package hugolib
import (
"bytes"
+ "fmt"
"errors"
+ jww "github.com/spf13/jwalterweatherman"
+
"github.com/fsnotify/fsnotify"
"github.com/gohugoio/hugo/helpers"
)
@@ -71,6 +74,11 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
h.Log.FEEDBACK.Println()
}
+ errorCount := h.Log.LogCountForLevel(jww.LevelError)
+ if errorCount > 0 {
+ return fmt.Errorf("logged %d error(s)", errorCount)
+ }
+
return nil
}