Skip to content

Cascade issue on multilingual site #14310

@jmooring

Description

@jmooring

Reference: https://discourse.gohugo.io/t/is-cascade-broken/56450

This occurs with v0.153.0 and later.

// Issue 14310
func TestIssue14310(t *testing.T) {
	t.Parallel()

	files := `
-- hugo.toml --
disableKinds = ['home','rss','sitemap','taxonomy','term']
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = true
[languages.en]
weight = 1
[languages.de]
weight = 2
-- layouts/all.html --
{{ .Params.color }}
-- content/s1/_index.de.md --
---
title: s1 (de)
cascade:
  params:
    color: red (de)
---
-- content/s1/_index.en.md --
---
title: s1 (en)
cascade:
  params:
    color: red (en)
---
-- content/s1/p1.de.md --
---
title: p1 (de)
---
-- content/s1/p1.en.md --
---
title: p1 (en)
---
`

	b := hugolib.Test(t, files)

	b.AssertFileContent("public/en/s1/p1/index.html", "red (en)")
	b.AssertFileContent("public/de/s1/p1/index.html", "red (de)") // fails: file contains "red (en)"
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions