Last active
December 22, 2021 03:58
-
-
Save aormsby/4a416da862e61893cf262be759fe2701 to your computer and use it in GitHub Desktop.
Sample shortcode for using mailgo.js in a Hugo site - automatically includes mailgo script in the page body when shortcode is used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- layouts/shortcodes/mailgo.html --> | |
{{ if .Get 1 }} | |
<span class="icon-link"> | |
<a href="#mailgo" data-address="{{ .Get 0 }}" data-domain="{{ .Get 1 }}" > | |
<img src="/icon/mailgo.png" alt="mailgo" {{ with .Get 2 }} height="{{ . }}" {{ end }} /> | |
</a> | |
<script src="https://cdn.jsdelivr.net/npm/mailgo@[VERSION]/dist/mailgo.min.js"></script> | |
</span> | |
{{ else }} | |
{{ errorf "missing email params" }} | |
{{ end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- content/posts/mypost.md --> | |
<!-- using mailgo shortcode.. | |
arg 0 - data-address | |
arg 1 - data-domain | |
arg 2 (optional) - icon height | |
--> | |
{{< mailgo ormsbyadam gmail.com 100 >}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment