Hi,
I’m building a site. This is an example page https://festive-bohr-4ac225.netlify.com/ricette/utilities/csv_popolazione_reisidenteistat/
In the top I have content tags
When a tag has a space, it’s not rendered. In the webpage above I have the riga di comando tag and it’s not rendered. The raw content page is this one https://raw.githubusercontent.com/opendatasicilia/tansignari-md/master/content/it/ricette/Utilities/csv_popolazione_reisidenteISTAT.md
This is the partial I use for rendering them https://github.com/opendatasicilia/tansignari-md/blob/master/layouts/partials/tags.html
How to render tags that have spaces?
Thank you
You are using urlize, which converts spaces to hyphens. I would suggest not using urlize.
Docs: https://gohugo.io/functions/urlize/
Edit:
{{ with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
<li class="horizontal">
<a href="{{ .Permalink }}">{{ $tag | urlize }}</a>
</li>
{{- end -}}
You probably need to urlize the first $tag call (for .GetPage)
{{ with $.Site.GetPage (printf "/%s/%s" $taxonomy (urlize $tag)) -}}
See example here: https://gohugo.io/templates/taxonomy-templates/#example-list-tags-in-a-single-page-template
1 Like
I have removed, but it has no sense. urlize removes the spaces, but my problem is not to have hello-world, my problem is that hello world is not rendered.
Thank you
Yes, I realised that belatedly. Please see my edited response.
This is because you are trying to $.Site.GetPage "tags/tag with space" instead of tags/tag-with-space, which is probably what is actually there.
Thank you for all @pointyfar !!
system
Closed
March 19, 2020, 11:43am
6
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.