Commit babcb33 1 parent 7203a95 commit babcb33 Copy full SHA for babcb33
File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ func (c ConfigLanguage) Environment() string {
71
71
}
72
72
73
73
func (c ConfigLanguage ) IsMultihost () bool {
74
+ if len (c .m .Languages )- len (c .config .C .DisabledLanguages ) <= 1 {
75
+ return false
76
+ }
74
77
return c .m .IsMultihost
75
78
}
76
79
Original file line number Diff line number Diff line change @@ -252,3 +252,31 @@ Files: {{ range $files }}{{ .Permalink }}|{{ end }}$
252
252
b .AssertFileContent ("public/en/enpages/mybundle-en/file2.txt" , "File 2 en." )
253
253
b .AssertFileContent ("public/fr/section/mybundle/file2.txt" , "File 2 en." )
254
254
}
255
+
256
+ func TestMultihostAllButOneLanguageDisabledIssue12288 (t * testing.T ) {
257
+ t .Parallel ()
258
+
259
+ files := `
260
+ -- hugo.toml --
261
+ defaultContentLanguage = "en"
262
+ disableLanguages = ["fr"]
263
+ #baseURL = "https://example.com"
264
+ [languages]
265
+ [languages.en]
266
+ baseURL = "https://example.en"
267
+ weight = 1
268
+ [languages.fr]
269
+ baseURL = "https://example.fr"
270
+ weight = 2
271
+ -- assets/css/main.css --
272
+ body { color: red; }
273
+ -- layouts/index.html --
274
+ {{ $css := resources.Get "css/main.css" | minify }}
275
+ CSS: {{ $css.Permalink }}|{{ $css.RelPermalink }}|
276
+ `
277
+
278
+ b := Test (t , files )
279
+
280
+ b .AssertFileContent ("public/css/main.min.css" , "body{color:red}" )
281
+ b .AssertFileContent ("public/index.html" , "CSS: https://example.en/css/main.min.css|/css/main.min.css|" )
282
+ }
You can’t perform that action at this time.
0 commit comments