I haven’t seen this after Googling around and searching this forum. The closest thing I’ve found is Title used in permalink does not have forward slash escaped · Issue #3577 · gohugoio/hugo · GitHub which references slashes.
So, I thought maybe I’ve just been overlooking something “obvious”?
My config sets posts = ":title"
for permalinks.
My post title is as such:
title: "tcg's cool posts #2"
On the list page, the code to display the post and link is:
<span class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></span>
The resulting HTML during local dev:
<a href="http://localhost:1313/tcgs-cool-posts-#2/">tcg's cool posts #2</a>
You can probably see that the URL is going to be a 404, because of the unescaped hash mark.
Is this expected?
I would think not, and it doesn’t seem like .Permalink
should require its own escaping. I also don’t feel right pre-escaping my post meta values.
Should I file a bug, or am I Doing It Wrong?
EDIT: Was using v0.42.2; seeing the same on v0.43