diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-09 15:18:13 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-02-10 18:48:53 +0200 |
commit | caba6ba6e78dfd124a60cee321de441f8b21ae11 (patch) | |
tree | 1aea62facf48242733d7016969bedb9390df5458 /hugolib/taxonomy_test.go | |
parent | f4575e5f29a04fd8613014d91b6bc63e83d37e69 (diff) |
Fix taxonomy term with backing file regression
Fixes #12020
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r-- | hugolib/taxonomy_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index 913f4c21d..ffcb8fb15 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -776,3 +776,42 @@ Len Book Authors: {{ len (index .Site.Taxonomies $taxonomy) }} b.AssertFileContent("public/index.html", "Len Book Authors: 2") } + +func TestTaxonomiesListTermsHome(t *testing.T) { + files := ` +-- hugo.toml -- +baseURL = "https://example.com" +[taxonomies] +tag = "tags" +-- content/_index.md -- +--- +title: "Home" +tags: ["a", "b", "c", "hello world"] +--- +-- content/tags/a/_index.md -- +--- +title: "A" +--- +-- content/tags/b/_index.md -- +--- +title: "B" +--- +-- content/tags/c/_index.md -- +--- +title: "C" +--- +-- content/tags/d/_index.md -- +--- +title: "D" +--- +-- content/tags/hello-world/_index.md -- +--- +title: "Hello World!" +--- +-- layouts/home.html -- +Terms: {{ range site.Taxonomies.tags }}{{ .Page.Title }}: {{ .Count }}|{{ end }}$ +` + b := Test(t, files) + + b.AssertFileContent("public/index.html", "Terms: A: 1|B: 1|C: 1|Hello World!: 1|$") +} |