aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-27 09:15:47 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-27 10:43:23 +0100
commit6bc0d745a5897b70a9356035f959ee0310e83fc9 (patch)
tree6ca5bb2020dddf176caeec3422e39539738039bb /hugolib
parent218690328cd2c379e3947cd7b330ca4353fae49b (diff)
downloadhugo-6bc0d745a5897b70a9356035f959ee0310e83fc9.tar.gz
hugo-6bc0d745a5897b70a9356035f959ee0310e83fc9.zip
Fix multihost processed image not copied to non-default content languages
Fixes #12163
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/hugo_sites_multihost_test.go46
1 files changed, 46 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_multihost_test.go b/hugolib/hugo_sites_multihost_test.go
index a9aad67b2..4b779ee92 100644
--- a/hugolib/hugo_sites_multihost_test.go
+++ b/hugolib/hugo_sites_multihost_test.go
@@ -162,6 +162,52 @@ title: "Mybundle fr"
b.AssertFileContent("public/fr/section/mybundle/styles.min.css", ".body{color:french}")
}
+func TestResourcePerLanguageIssue12163(t *testing.T) {
+ files := `
+-- hugo.toml --
+defaultContentLanguage = 'de'
+disableKinds = ['rss','sitemap','taxonomy','term']
+
+[languages.de]
+baseURL = 'https://de.example.org/'
+contentDir = 'content/de'
+weight = 1
+
+[languages.en]
+baseURL = 'https://en.example.org/'
+contentDir = 'content/en'
+weight = 2
+-- content/de/mybundle/index.md --
+---
+title: mybundle-de
+---
+-- content/de/mybundle/pixel.png --
+iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==
+-- content/en/mybundle/index.md --
+---
+title: mybundle-en
+---
+-- layouts/_default/single.html --
+{{ with .Resources.Get "pixel.png" }}
+ {{ with .Resize "2x2" }}
+ {{ .RelPermalink }}|
+ {{ end }}
+{{ end }}
+`
+
+ b := Test(t, files)
+
+ b.AssertFileExists("public/de/mybundle/index.html", true)
+ b.AssertFileExists("public/en/mybundle/index.html", true)
+
+ b.AssertFileExists("public/de/mybundle/pixel.png", true)
+ b.AssertFileExists("public/en/mybundle/pixel.png", true)
+
+ b.AssertFileExists("public/de/mybundle/pixel_hu8aa3346827e49d756ff4e630147c42b5_70_2x2_resize_box_3.png", true)
+ // failing test below
+ b.AssertFileExists("public/en/mybundle/pixel_hu8aa3346827e49d756ff4e630147c42b5_70_2x2_resize_box_3.png", true)
+}
+
func TestMultihostResourceOneBaseURLWithSuPath(t *testing.T) {
files := `
-- hugo.toml --