HUGO

How do i add hugo variable in different statement

Perfumes by {{ .Title }}
{{ range .Site.Taxonomies.companies.hard-coded-category}}
<li><a href="{{ .Page.URL }}">{{ .Page.Params.perfume.name }}</a></li>
{{ end }}

Is there any way by which I can put the value of “.Title” in place of “hard-coded-category”?

what all I have tried:

storing the value of “.Title” in some variable {{ $someVariable := .Title }} and the replacing hard-coded-category with it. I didn’t work.

Tried same using $scratch.Set, that also didn’t work

Do your company taxonomies have a title attribute?

Title is a page attribute, you can use it only in the range loop

taxonomies do not have the title attribute. but in this range statement, I want to put page title in place of “hard-coded-category”

{{ range .Site.Taxonomies.companies.hard-coded-category}}

so that it shows all the pages which have my page title as a category.