Trying to inject `{{` in email URL

I’m trying to build html email templates for Netlify’s identify consumption.

Netlify Identity lets you customize the emails it sends to users by hosting those files yourself and pointing Netlify to them.
Ideally I’d like Hugo to be able to generate those files with some simple Front Matter added to content files.

But to this day, I’m unable to inject the curly bracketed variables required by Netlify inside a href attribute. I’m trying to put this string:{{ .Token }}

I’ve tried all the safe functions I know including htmlUnescape but none will work.

href="{{ print `{{ .Token }}` }}

I even tried wrapping the whole string in a print:

{{ print `` `{{ .Token }}` | safeJS }}

it will systematically print


Has anybody done work with curly brackets inside href attributes?

Use printf.

Producing a different escaping, but still escaping somehow. I’ve created a repo for tests.

I managed by including part of the tag in the print statement:

    {{ print `<a href="{{ .Token }}" ` | safeHTML }}
      class="text-lg bg-blue-500">
      Click Here

It’s fine but I wonder if there’s a better way.