I have an error in an if that I use to check if an image url has been set. I’m getting an error when running as Hugo seems to parse the content of the if, even when it should ignore it.
{{ if and (isset .Params "imageurl") (not (eq .Params.imageurl "")) }}
{{ $image_path := substr .Params.imageurl 0 -4 }}
{{ $image_path }}
{{ end }}
I assume this is a nuance of the templating system, and might just be how it works, but am I missing something? Is there a better way to do this?