{{ $bla := "-/-" }}
{{ if .Page.IsPage }}
{{ $bla := "page" }}
{{ else }}
{{ $bla := "branch" }}
{{ end }}
Content is {{ printf "%s" $bla }}
Assume I have the above in a layout.
Guess my surprise when the layout spit out “-/-” rather then page or branch.
In those hundred programming languages I already forgot about in my life, I always thought there is if and else and one of them will be executed. Today I learned there is alternatives. Just do nothing. Is this template language a government project?
Or might I have missed an important aspect?
Stunned
Adrian