How to check if dynamically-named variable exists in context?

Of course… didn’t think of that – two separate ifs:

{{ if isset .Params "author" }}{{ if isset .Site.Data.authors .Params.author }}

Thanks @agh ! Not very clean, but it’s not the first time Go templates leave me feeling dirty.

1 Like