mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +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:
@@ -1069,6 +1069,7 @@ func createMultiTestSitesForConfig(t *testing.T, siteConfig testSiteConfig, conf
|
||||
|
||||
mf := siteConfig.Fs
|
||||
|
||||
// TODO(bep) cleanup/remove duplication, use the new testBuilder in testhelpers_test
|
||||
// Add some layouts
|
||||
if err := afero.WriteFile(mf,
|
||||
filepath.Join("layouts", "_default/single.html"),
|
||||
@@ -1368,7 +1369,7 @@ func readSource(t *testing.T, fs *hugofs.Fs, filename string) string {
|
||||
}
|
||||
|
||||
func readFileFromFs(t testing.TB, fs afero.Fs, filename string) string {
|
||||
filename = filepath.FromSlash(filename)
|
||||
filename = filepath.Clean(filename)
|
||||
b, err := afero.ReadFile(fs, filename)
|
||||
if err != nil {
|
||||
// Print some debug info
|
||||
|
Reference in New Issue
Block a user