diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-17 12:00:40 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-17 12:34:50 +0100 |
commit | 5bdda0bdbf5eca4064d395219d0797aaed24070f (patch) | |
tree | 7473bd704dfe0ca841e5498704edfaceab31604c /hugolib/taxonomy_test.go | |
parent | 9679443c15e734f5b469c61ebf7afa2e000e9cbc (diff) |
Don't use the same value in .Data.Term.Title as in .Title
Fixes #12041
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r-- | hugolib/taxonomy_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index ffcb8fb15..17e1b6cd4 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -815,3 +815,23 @@ Terms: {{ range site.Taxonomies.tags }}{{ .Page.Title }}: {{ .Count }}|{{ end }} b.AssertFileContent("public/index.html", "Terms: A: 1|B: 1|C: 1|Hello World!: 1|$") } + +func TestTaxonomiesTermTitleAndTerm(t *testing.T) { + files := ` +-- hugo.toml -- +baseURL = "https://example.com" +[taxonomies] +tag = "tags" +-- content/_index.md -- +--- +title: "Home" +tags: ["hellO world"] +--- +-- layouts/_default/term.html -- +{{ .Title }}|{{ .Kind }}|{{ .Data.Singular }}|{{ .Data.Plural }}|{{ .Page.Data.Term }}| +` + + b := Test(t, files) + + b.AssertFileContent("public/tags/hello-world/index.html", "HellO World|term|tag|tags|hellO world|") +} |