Hi dissus community
I was just going to write a feature in taxonomy that would unify
the same singular and plural terms (accidentally entered in Front Matter),
however, there is no such need, Hugo already has it! (Explanation below the introduction)
Great hugo did the work for me
it’s just pure inquisitiveness
p’tit introduction
I am building a portfolio that is to include graphic works of a designer,
I used the native categories
to add terms to it, e.g .: pancartes
, vectors
, illustrations
, …
I assume the user might have made a mistake and typed singular categories: illustration
.Data.Terms
vs .Site.Taxonomies
I noticed that WeightedPages obtained from .Site.Taxonomies.categories
distinguishes between illustrations
and illustration
,
but the .Data.Terms
returns WeightedPages where illustration
was unified with illustrations
.
Experimentation has revealed that even entering illustratio
, illustra
, and even just i
will unify these terms in the map .Data.Terms.illustrations
And even the value of .Param.categories
is replaced:
For demo: We have only two pages “dragon.md” with categories: illustra
and “monster.md” with categories: illustrations
:
{{ range .Data.Terms }}
{{ .Pages }} => Pages(2)
{{ $firstWeightedPage := index . 0 }}
{{ $firstWeightedPage.Params.categories }} => [illustrations]
{{ $firstWeightedPage.Page.Params.categories }} => [illustrations]
{{ end }}
but with range .Site.Taxonomies
, we got two terms:
illustra
and
illustrations
where each will keep the value of .Params.categories
as is.
it is amazing
Where can I learn more about this