poffy
#1
Using something like:
‘<‘main’>‘
TAB{{ .Content }}
’<’/main’>’
in a template, the end result in html is:
‘<‘main’>‘
TABmy-content
Blank-line
’<’/‘main’>’
I know it doesn’t matter but I wish to understand better how variables are invoked in Hugo. Why is there this new line printed?
EDIT: I can’t get the formatting rules of that forum. Things like ‘<‘main’>’ are not displayed if I remove the quotes…
bep
#2
See if:
{{- .Content -}}
Helps. White space and Go templates can be a challenge. You need to look at their documentation to get some insight.
poffy
#3
Thanks for your answer. I get interesting results with
{{ .Content -}}
if I had:
TAB’<‘main’>‘
TABTAB{{ .Content -}}
TAB’<’/‘main’>’
This now gives me:
TAB’<‘main’>‘
TABTABmy-content
<’/main’>’
and my last Tab disapears.