Dear irkode, thank you very much for looking into this!
Sorry I didn’t explain my case well enough - I’ll try to once again:
With frontmatter tags key being at the top level of data, looking like this (1 tag per file):
tags: 'womens-tops'
I used this tag filter to find files having the tag and show their number:
<li>
{{- if isset .Site.Taxonomies "tags" }}
{{- if not (eq (len .Site.Taxonomies.tags) 0) }}
<ul class="list-unstyled">
{{ range $name, $items := .Site.Taxonomies.tags }}
<li class="small">
<a class="cat-item d-flex justify-content-between text-dark"
href="{{ `tags/` | relLangURL }}{{ $name | urlize | lower }}">{{ T $name | humanize }}<span>{{len $items}}</span></a>
</li>
{{- end }}
</ul>
{{- end }}
{{- end }}
</li>
The output was a clickable link something like this:
Womens tops 3
Now the situation evolved to 1 file holding data on more than 1 product and there is necessity to have a few tags at the top level of data (taxonomy does not work with nested tags):
tags: ["womens-tops", "womens-pants"]
and I am trying to adjust the search code to accomodate a few tags.
The ideal output would be clickable translated links something like this:
Womens tops 3
Womens pants 2
where 2 and 3 are number of items having the tags, but so far I could not achieve it.
The best I could achieve so far - with top-level frontmatter key (without suare brackets):
tags: “womens-tops”, “womens-pants”
the output would be a clickable link of the kind:
Womens tops, Womens pants 1
where 1 is a number of files having the tags, and at that I can not apply the T function to translate the tags, even using the delimit function.
I tried your filter code, but it does the same thing that my code does.
jmooring had a good idea here: Add commas between tags range, but I could not make it work.
I will appreciate if you can suggest any solution for my problem.
Thanks!