mph.paste.lol / tags.html · 1 year ago·

<!-- 
*** REMOVE THIS COMMENT BEFORE USING !! ***

Hugo shortcode to make hashtags that link to my home mastodon instance. 

Save it in `your_site_root/layouts/shortcodes/tags.html` and invoke it like this:

{{% tags "#portland #pdx #MtScott #FosterRoad #photography" %}} 

Currently it points to social.lol for the Mastodon instance. You can swap in your own. 

If you don't use FontAwesome or don't want the Mastodon icon at the front, remove the <i> tag 
at the beginning of the third line.

If you use Drafts and would like to make creating the shortcode a little easier, here's an action:

https://directory.getdrafts.com/a/2Fu

*** REMOVE THIS COMMENT BEFORE USING !! ***
--> 


{{ $tags_list := index .Params 0 }}
{{ $tags := split $tags_list " " }}
<i class="fa-brands fa-mastodon"></i> {{ range $tags }}<a href="https://social.lol/tags/{{ substr . 1 }}">{{ . }}</a> {{ end }}