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

tags with white spaces in them are rendered with empty hrefs

Open loboto51 opened this issue 2 years ago • 0 comments

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 !

loboto51 avatar Jul 04 '22 19:07 loboto51