# Taxonomy terms .Permalink - spaces vs. dashes

**URL:** <https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629>\
**Category:** support\
**Created:** [March 3, 2024, 8:11am UTC](https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629 "2024-03-03T08:11:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [March 3, 2024, 8:11am UTC](https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629/1 "2024-03-03T08:11:42Z")

</div>

The following code:

```gotemplate
{{- with (.GetTerms "tags") -}}
  <div class="d-flex flex-row gap-2">
    <div class="icon">
      {{- partials.Include "icon.html" "tags" }}
    </div>
    <div class="d-flex flex-row gap-2">
      <span>{{ lang.Translate "theme.tags" }}: </span>
      {{- range . -}}
        <a rel="tag" href="{{- .Permalink -}}"
          >#{{- .Title | urlize | lower -}}</a
        >
      {{- end -}}
    </div>
  </div>
{{- end -}}

```

leads to links in the `{{- .Permalink -}}` part that come as `me%20now`. The tag term is actually `me now` (space). Hugo creates the page as `me-now`.

This started with recent Hugo versions. Is there a way to correctly call the permalink or do I have to “hack” somehow a space to dash conversion for the link?

Before the display was with space and Hugo linked and created dashed.

I wonder where I went wrong in that Hugo is creating the page with dashes, but then in the .Permalink uses spaces.

Sample:

- built: [https://kollitsch.dev/tags/me-now/](https://kollitsch.dev/tags/me-now/)
- linked (layout above): [https://kollitsch.dev/tags/me%20now/](https://kollitsch.dev/tags/me%20now/)

config/\_default/taxonomies.toml:

```toml
tag = "tags"

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 3, 2024, 3:25pm UTC](https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629/2 "2024-03-03T15:25:59Z")

</div>

You are currently seeing this:

> Posts tagged with #Me-Now

What do you want to see?

> [@davidsneighbour](#):
>
> Hugo is creating the page with dashes, but then in the .Permalink uses spaces

I cannot reproduce this.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [March 3, 2024, 4:06pm UTC](https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629/3 "2024-03-03T16:06:09Z")

</div>

That “Posts tagged with #Me-Now” is the second level of issues. Before it showed “#me-now” (I don’t have proof of that, but it would have taken my interest somehow if it happened that way). I fixed the initial issue above (dashes vs. spaces) with renaming all my tags so they don’t have spaces. I think that is the easiest way to fix _my_ issue.

Before I saw “#me-now” as title of these tags.

There are plenty of other tags with spaces in my blog, but I refactored them all into having dashes and GoHugo is happily doing “the right thing” now.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [March 3, 2024, 4:08pm UTC](https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629/4 "2024-03-03T16:08:52Z")

</div>

> [@jmooring](#):
>
> I cannot reproduce this.

not anymore probably because I fixed it on the live website. Maybe at [this commit](https://github.com/davidsneighbour/kollitsch.dev/tree/5e382ffb5c12bf4d14f184b0306d91de44a4c39e) it will show.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 3, 2024, 4:26pm UTC](https://discourse.gohugo.io/t/taxonomy-terms-permalink-spaces-vs-dashes/48629/5 "2024-03-03T16:26:21Z")

</div>

#### Capitalization

Hugo has always capitalized the title of section and taxonomy pages that are not backed by a file. With the introduction of v0.123.0, Hugo also capitalizes the title of term pages that are not backed by a file. With v0.123.3 and later you can (finally) disable auto-capitalization:

```auto
capitalizeListTitles = false # default is true
pluralizeListTitles = false # default is true

```

If we were starting over both would default to false. The current defaults are backward compatible, but don’t make much sense.

#### Spaces vs. hyphens

Regardless of version, the assigned terms “a b” and “a-b” are equivalent with respect to the internal identifier and the relative permalink.

v0.122.0…

| assigned  
term | internal  
identifier | title | relpermalink\[1\] |
| --- | --- | --- | --- |
| `a b` | `a-b` | `a-b` | `/tags/a-b/index.html` |
| `a-b` | `a-b` | `a-b` | `/tags/a-b/index.html` |

v0.123.0 and later…

| assigned  
term | internal  
identifier | title\[2\] | relpermalink\[1:1\] |
| --- | --- | --- | --- |
| `a b` | `a-b` | `A-B` | `/tags/a-b/index.html` |
| `a-b` | `a-b` | `A-B` | `/tags/a-b/index.html` |

* * *

EDIT: There seems to be some indeterminacy when PAGE-A has tag “a b” and PAGE-B has tag “a-b”. We’re not detecting a page collision when building with `--printPathWarnings`. See [#12202](https://github.com/gohugoio/hugo/issues/12202)

* * *

1. Assumes you have not set `permalinks` in your site configuration 

2. Assumes that `capitalizeListTitles` is not set to `false`
