I’m unable to define a variable inside of an {{ .IsPage }}
block with Hugo v0.13.
The following works, and outputs the string ‘yes’:
{{ if .IsPage }}yes{{ end}}
The following do not work:
{{ if .IsPage }}{{ $section := 'yes' }}{{ end }}
{{ if .IsPage }}{{ $section := .Section }}{{ end }}
{{ $section }}
ERROR: 2015/05/04 template partials/sidebar.html:30: undefined variable "$section"