Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multilingual multihost: Processed image not copied to non-default content languages #12163

Closed
jmooring opened this issue Feb 26, 2024 · 2 comments · Fixed by #12167
Closed

multilingual multihost: Processed image not copied to non-default content languages #12163

jmooring opened this issue Feb 26, 2024 · 2 comments · Fixed by #12167

Comments

@jmooring
Copy link
Member

failing test case
func TestFoo(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)
}

Reference: https://discourse.gohugo.io/t/issue-with-images-in-a-multilingual-multihost-configuration/48501

@bep bep self-assigned this Feb 27, 2024
@bep bep removed the NeedsTriage label Feb 27, 2024
@bep bep added this to the v0.123.5 milestone Feb 27, 2024
@bep
Copy link
Member

bep commented Feb 27, 2024

@jmooring I will have a look at this, just wanted to chime in and say I appreciate the failing test cases. It makes it so much easier to dig into these issues.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants