Blank lines in generated HTML code

Hey guys,

Love hugo! It’s really great and helped me to start several smaller websites. One thing which is bothering me are the blank lines in the generated HTML code:

Do you think that it would be possible to remove blank lines during the generation of the static content? The answer in https://discuss.gohugo.io/t/how-do-i-avoid-the-blank-lines-in-the-generated-html/3157 is not helpfil, because I do not have comments in these lines.

Thanks!

Starting in Hugo 0.16, manage whitespace with a minus sign like this:

{{23 -}}
   <
{{- 45}}

This yields 23<45.

Compliments of Go 1.6 templates.

3 Likes

Thank you @moorereason! It works, it just took me a little time to understand, but looks great!