Repository: gohugoio/hugo (language: go)

Issue:
Template lookup order no longer finds layouts/taxonomy/tag.html
This worked with v0.122.0 and earlier:

```
layouts/taxonomy/tag.html
```

That template is not found with v0.123.0 and later.

These don't work either:
- layouts/_default/tag.html
- layouts/_default/tag.html.html
- layouts/taxonomy/tag.html.html

Reference: <https://discourse.gohugo.io/t/0-123-removed-my-tag-descriptions/48462>


Discussion / hints:

Fix patch:
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index ba0c858fea7..89df951e93f 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -1552,8 +1552,10 @@ func (sa *sitePagesAssembler) assembleTermsAndTranslations() error {
 						}
 						pages.InsertIntoValuesDimension(pi.Base(), n)
 						term = pages.Get(pi.Base())
-					} else if term.(*pageState).m.term != v {
-						term.(*pageState).m.term = v
+					} else {
+						m := term.(*pageState).m
+						m.term = v
+						m.singular = viewName.singular
 					}
 
 					if s == "" {


Test patch:
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go
index 629db185a19..5a48df3b7cf 100644
--- a/hugolib/taxonomy_test.go
+++ b/hugolib/taxonomy_test.go
@@ -885,3 +885,29 @@ build:
 	b.AssertFileExists("public/tags/a/index.html", false)
 	b.AssertFileContent("public/index.html", "|0|")
 }
+
+func TestTaxonomiesTermLookup(t *testing.T) {
+	t.Parallel()
+
+	files := `
+-- hugo.toml --
+baseURL = "https://example.com"
+[taxonomies]
+tag = "tags"
+-- content/_index.md --
+---
+title: "Home"
+tags: ["a", "b"]
+---
+-- layouts/taxonomy/tag.html --
+Tag: {{ .Title }}|
+-- content/tags/a/_index.md --
+---
+title: tag-a-title-override
+---
+`
+
+	b := Test(t, files)
+
+	b.AssertFileContent("public/tags/a/index.html", "Tag: tag-a-title-override|")
+}