I thought there was a discussion about this here, but I can’t find it right now. Golang issue 9969 just got resolved, meaning template blocks can now be configured to trim leading and trailing whitespace. e.g. this:
{{23 -}}
<
{{- 45}}
Will now output:
23<45
Rather than:
23
<
45
It’s not a huge deal, since Hugo mostly deals with HTML, but it’s still a long-awaited feature. Looking forward to it making it’s way into Hugo.
This depends on the Go version used to build Hugo. If I’m not mistaken, this just got into the Go code base (???) and I’m not sure when Go 1.6 will come out.
Is the current binary download compiled with this feature?
I would like to get rid of that annoying empty lines too without constructing a gulp pipeline just for this.
No, this feature was added to Go 1.6, which was released on Feb. 17. Hugo 0.15 was released on Nov. 25. The next release of Hugo will be compiled with Go 1.6.