diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-03-15 09:37:30 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-03-16 10:10:01 +0100 |
commit | ffaec4ca8c4c6fd05b195879ccd65acf2fd5a6ac (patch) | |
tree | 28d4a68d5b41d5ccd769208856d0e3b4f086ebe5 /hugolib/shortcode_test.go | |
parent | 91fb8f1b59cce50de914d66dac1d406655c3c43b (diff) | |
download | hugo-ffaec4ca8c4c6fd05b195879ccd65acf2fd5a6ac.tar.gz hugo-ffaec4ca8c4c6fd05b195879ccd65acf2fd5a6ac.zip |
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/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 763394032..449d55abd 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -673,7 +673,8 @@ NotFound: {{< thisDoesNotExist >}} writeSource(t, fs, "content/sect/mycsvpage.md", fmt.Sprintf(pageTemplateCSVOnly, "Single CSV")) writeSource(t, fs, "content/sect/notfound.md", fmt.Sprintf(pageTemplateShortcodeNotFound, "Single CSV")) - require.NoError(t, h.Build(BuildCfg{})) + err := h.Build(BuildCfg{}) + require.Equal(t, "logged 1 error(s)", err.Error()) require.Len(t, h.Sites, 1) s := h.Sites[0] |