I'm trying to build a custom theme for hugo. This is my first time using Go and I was wondering what are the dashes in the code below?
{{- partial "head.html" . -}}
Here is the whole file if needed:
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html>
Are the dashes there for any reason and if yes when should I use them?
Per the documentation here: https://gohugo.io/templates/introduction/#whitespace
Go 1.6 includes the ability to trim the whitespace from either side of a Go tag by including a hyphen (-) and space immediately beside the corresponding {{ or }} delimiter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With