diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-08-14 12:04:17 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-08-14 12:04:17 +0200 |
commit | 56c61559b2a9f9c4cec3f6c6de9bcc5095a78b57 (patch) | |
tree | d9ff8edaac9ccb64284bc28919609e0015c8ce3f /hugolib/resource_chain_test.go | |
parent | 78f8475a054a6277d37f13329afd240b00dc9408 (diff) |
Only duplicate resource output in multihost mode
Yesterday's commit was a little too agressive.
This commit makes sure that the duplication of resources to public/en etc. is only performed in multihost mode.
See #5058
Diffstat (limited to 'hugolib/resource_chain_test.go')
-rw-r--r-- | hugolib/resource_chain_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go index 0a4c3bd1f..ad0d9611c 100644 --- a/hugolib/resource_chain_test.go +++ b/hugolib/resource_chain_test.go @@ -385,3 +385,20 @@ $color: #333; test.verify(b) } } + +func TestMultiSiteResource(t *testing.T) { + t.Parallel() + assert := require.New(t) + + b := newMultiSiteTestDefaultBuilder(t) + + b.CreateSites().Build(BuildCfg{}) + + // This build is multilingual, but not multihost. There should be only one pipes.txt + b.AssertFileContent("public/fr/index.html", "French Home Page", "String Resource: /blog/text/pipes.txt") + assert.False(b.CheckExists("public/fr/text/pipes.txt")) + assert.False(b.CheckExists("public/en/text/pipes.txt")) + b.AssertFileContent("public/en/index.html", "Default Home Page", "String Resource: /blog/text/pipes.txt") + b.AssertFileContent("public/text/pipes.txt", "Hugo Pipes") + +} |