mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 22:16:02 +00:00
Fix a bug with taxonomy rendering.
- In `layouts/_default/taxonomy.html`, the `.Data` result does not
provide the same information that `layouts/_default/terms.html` does
for being able to identify the plural value of the term.
- This change adds `.Data.Singular` and `.Data.Plural` to provide
similar capabilities.
- This *may* be incompatible with templates that check for `{{ if ne
$taxonomy "Pages" }}` if the `page.Params` has either the singular or
plural values as keys.
This commit is contained in:
1 parent
d7e6e490c2
commit
d467ec0aab
1 file changed
+2
@@ -843,6 +843,8 @@ func (s *Site) newTaxonomyNode(t taxRenderInfo) (*Node, string) {
|
|||||||
n.Date = t.pages[0].Page.Date
|
n.Date = t.pages[0].Page.Date
|
||||||
}
|
}
|
||||||
n.Data[t.singular] = t.pages
|
n.Data[t.singular] = t.pages
|
||||||
|
n.Data["Singular"] = t.singular
|
||||||
|
n.Data["Plural"] = t.plural
|
||||||
n.Data["Pages"] = t.pages.Pages()
|
n.Data["Pages"] = t.pages.Pages()
|
||||||
return n, base
|
return n, base
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user