I want the link to this blog in my Mastodon profile to be “verified” (green) link. This is done by adding a custom anchor element somewhere on the site:
<a rel='me' href='https://mastodon.social/@romanboehm'>Mastodon</a>
By default, however, Hugo, the static site generator of my choice, does not permit this.
If you don’t like to activate the renderer’s unsafe mode in order to be able to insert raw html, you can achieve this with so-called shortcodes:
layouts/shortcodes
. I called it rawhtml.html.{{.Inner}}
as the file’s content.{{< rawhtml >}}<b>foo</b>{{< /rawhtml >}}
.Or, for the case of adding the “verifiable” link:
{{< rawhtml >}}<a rel='me' href='https://mastodon.social/@romanboehm'>Mastodon</a>{{< /rawhtml >}}
(Note the single quotes for the attribute values)
You can view the whole commit on GitHub.