How can I keep comments in HTML source?

Adding two pence, if you need a one-off comment, it’s doable via a variable in the Front Matter. For example, I’m using that for ASCII art, see this post.

But comments in HTML in bulk is not a common thing people need; you’ll need hacks and workarounds for that. I like that Hugo does the removal of comments automatically.