[SOLVED] Listing category names with proper case

The code below is displaying a list of the categories in my blog. Yet, every time I call $key the name is already a slug url like “johnny-five” instead of “Johnny Five”.

What am I missing here?

<ul>
{{ $baseurl := .Site.BaseURL }}
{{ range $key, $value := .Site.Taxonomies.categories }}
    <li><a href="{{ $baseurl  }}categories/{{ $key | urlize  }}">{{ $key }}</a> ({{ len $value }})</li>
{{ end }}
</ul>

A better solution to this will come, but until then you can try:

preservetaxonomynames: true

In your site config.

1 Like

That was it, thank you very much :slight_smile: