Mitrichius / hugo-theme-anubis

Anubis is a simple minimalist theme for Hugo blog engine
https://hugo-theme-anubis.netlify.app/
MIT License
397 stars 152 forks source link

tags with white spaces in them are rendered with empty hrefs #164

Closed loboto51 closed 1 year ago

loboto51 commented 2 years ago

Hello, I've added some tags in my posts with whitespaces in them, and when Hugo renders the pages, the href is empty. ex : Tag = bla bla, gets an empty href instead of href=tags/bla-bla

A solution I've found is to alter the layout partials/post-info.html to urlize tag names like this : {{ $tag := ($.Site.GetPage (printf "/tags/%s" (urlize $tag_name))) }} Instead of : {{ $tag := ($.Site.GetPage (printf "/tags/%s" $tag_name)) }}

This way the href are rendered correctly.

Note: If it is the right way of doing it, the same altering should be applied to the categories a few lines above : {{ $cat := ($.Site.GetPage (printf "/categories/%s" (urlize $cat_name))) }} Instead of : {{ $cat := ($.Site.GetPage (printf "/categories/%s" $cat_name)) }}

Thank you for this nice theme !

Mitrichius commented 1 year ago

Fixed, thanks! And sorry for the long wait.