Skip to content

Instantly share code, notes, and snippets.

View aormsby's full-sized avatar

Adam Ormsby aormsby

View GitHub Profile
@aormsby
aormsby / hugo-deploy.sh
Last active December 20, 2021 14:08
A sweet shell deploy script for Hugo sites - built with submodules in mind, but easy to modify for use without them. Runs with options, see blog for full rundown - https://www.adamormsby.com/posts/hugo-shell-deploy-script/
#!/bin/sh
# region settings
# BUILD/DEPLOY SETTINGS - edit as needed for your use case
PUB_SUBMODULE="public" # name of output folder where git submodule is located
IGNORE_FILES=". .. .git CNAME" # space-delimited array of files to protect when 'fresh' option is used
DEV_BRANCHES="dev dev" # development branches to build on and push to, 1-root, 2-pubmodule
PROD_BRANCHES="master master" # production branches to build on and push to, 1-root, 2-pubmodule
# endregion
@aormsby
aormsby / mailgo.html
Last active December 22, 2021 03:58
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>