This is not a standalone theme. It is a Hugo theme component providing a shortcode: cloakemail
to cloak any e-mail or other messaging (xmpp
, tg
, etc.) or phone (sip
, tel
, etc.) address from spamming bots.
- Add the
hugo-cloak-email
as a submodule to be able to get upstream changes latergit submodule add https://github.com/martignoni/hugo-cloak-email.git themes/hugo-cloak-email
- Add
hugo-cloak-email
as the left-most element of thetheme
list variable in your site's or theme's configuration fileconfig.yaml
orconfig.toml
. Example, withconfig.yaml
:or, withtheme: ["hugo-cloak-email", "my-theme"]
config.toml
,theme = ["hugo-cloak-email", "my-theme"]
- In your site, use the shortcode, this way:
or
{{< cloakemail "[email protected]" >}}
{{< cloakemail address="[email protected]" >}}
- You may specify a protocol, this way:
or
{{< cloakemail address="[email protected]" protocol="xmpp" >}}
{{< cloakemail address="+1 212 664-7665" protocol="tel" >}}
- or a class, this way:
{{< cloakemail address="[email protected]" class="vip" >}}
- or a text to be display instead of the e-mail address, this way:
{{< cloakemail address="[email protected]" display="Send us a mail!" >}}
All parameters can be combined.
Copyright © 2019 onwards, Nicolas Martignoni [email protected].
Thanks to @mxmehl for ideas and explanations about other protocols and script fingerprinting.
This theme component was possible because of the work done by @danieka in this pull request.