Skip to content

Instantly share code, notes, and snippets.

@aormsby

aormsby/mailgo.html

Last active Mar 18, 2020
Embed
What would you like to do?
Sample shortcode for using mailgo.js in a Hugo site - automatically includes mailgo script in the page body when shortcode is used.
<!-- 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 }}
<!-- 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
You can’t perform that action at this time.