Skip to content

A Hugo theme component to cloak email adresses

License

Notifications You must be signed in to change notification settings

tv-aku/hugo-cloak-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hugo-cloak-email

Awesome

About

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.

Usage

  1. Add the hugo-cloak-email as a submodule to be able to get upstream changes later git submodule add https://github.com/martignoni/hugo-cloak-email.git themes/hugo-cloak-email
  2. Add hugo-cloak-email as the left-most element of the theme list variable in your site's or theme's configuration file config.yaml or config.toml. Example, with config.yaml:
    theme: ["hugo-cloak-email", "my-theme"]
    or, with config.toml,
    theme = ["hugo-cloak-email", "my-theme"]
  3. In your site, use the shortcode, this way:
    {{< cloakemail "[email protected]" >}}
    or
    {{< cloakemail address="[email protected]" >}}
  4. You may specify a protocol, this way:
    {{< cloakemail address="[email protected]" protocol="xmpp" >}}
    or
    {{< cloakemail address="+1 212 664-7665" protocol="tel" >}}
  5. or a class, this way:
    {{< cloakemail address="[email protected]" class="vip" >}}
  6. 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.

Credits

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.

About

A Hugo theme component to cloak email adresses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 100.0%