hugo-theme-codex icon indicating copy to clipboard operation
hugo-theme-codex copied to clipboard

Tags are shown in urlize form in taxonomies, changes spaces to dashes and turns everything lowercase

Open mejedi opened this issue 4 years ago • 0 comments

I like to use tags with spaces; also capitalisation matters. A fix as per Hugo docs:

diff --git a/themes/codex/layouts/partials/browse-by-tag.html b/themes/codex/layouts/partials/browse-by-tag.html
index 65a3550..5990af7 100644
--- a/themes/codex/layouts/partials/browse-by-tag.html
+++ b/themes/codex/layouts/partials/browse-by-tag.html
@@ -1,7 +1,7 @@
 <ul class="tags__list">
-  {{ range $tag, $value := $.Site.Taxonomies.tags }}
+  {{ range $.Site.Taxonomies.tags }}
   <li class="tag__item">
-    <a class="tag__link" href="{{ "/tags/" | relLangURL}}{{ $tag | urlize }}/">{{ $tag }} ({{ len $value }})</a>
+    <a class="tag__link" href="{{ .Page.Permalink }}">{{ .Page.Title }} ({{ .Count }})</a>
   </li>
   {{ end }}
 </ul>
diff --g

mejedi avatar Feb 07 '21 16:02 mejedi