I was trying to insert an image from frontmatter into my template but kept getting the same error. I solved it thus:
{{ if isset .Params "image" }}
{{ $myVar := print .Params.image }}
<img src="{{ $myVar }}">
{{ end }}
Notice that I first save the .Params.image
as a variable, and then insert it as my src
.