Anatole: Tag “C#” page show 404

Created on 18 Mar 2021  ·  5Comments  ·  Source: lxndrblz/anatole

When I click on the C# tag, page 404 appears. How did I figure it out that the " # " symbol is specific. How is this resolved?

bug

All 5 comments

Thanks for bringing this up. I'll need to investigate this and report back!

@GhostBasenji I was doing some digging and it seems like certain characters don't work well with Hugo/YAML and it's unfortunately not just a limitation of this theme. The problem is that certain characters are reserved according to the RFC Standard

https://discourse.gohugo.io/t/sanitizing-category-names/11087
https://github.com/gohugoio/hugo/issues/4519
https://discourse.gohugo.io/search?q=special%20characters%20in%20url

I was wondering did C# work you before in another theme?

There are... For example, this... https://github.com/GhostBasenji/blog-src and https://github.com/GhostBasenji/blog-src/blob/master/themes/notepadium/layouts/partials/note-list.html (or https://github.com/cntrump/hugo-notepadium)

Or as a solution, can leave C# in the tags, and in the address bar like this: /tag/c.

@GhostBasenji Thanks I will check how they circumvent the issue.

It appears as they simply replace the problematic characters:

https://github.com/cntrump/hugo-notepadium/blob/37a4b7215f4fb563035eb9c1b8f661defc7b9954/layouts/partials/note-labels.html

  {{- range .Params.tags -}}
      {{- $tag := replace . "#" "%23" -}}
      {{- $tag = replace $tag "." "%2e" -}}
      {{- $url := print "/tags/" ($tag | urlize) "/" -}}
      <a class="tag" href="{{- $url | relLangURL -}}">{{- . -}}</a>
  {{- end -}}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jwalsh2me picture jwalsh2me  ·  6Comments

xiangli2pro picture xiangli2pro  ·  3Comments

codyleyhan picture codyleyhan  ·  4Comments

Sptandi picture Sptandi  ·  4Comments

tangxuemei1995 picture tangxuemei1995  ·  4Comments