diff options
author | Alok G Singh <alephnull@gmail.com> | 2019-10-01 07:59:43 +0300 |
---|---|---|
committer | zwbetz-gh <37317628+zwbetz-gh@users.noreply.github.com> | 2019-10-01 07:59:43 +0300 |
commit | 341eb1eb1c90b09f33d46104fa2477b80eedc83d (patch) | |
tree | de8fc9ad2edbf6ac7dbb4d51905eb3adccfbe4bf /layouts | |
parent | 0c4285641b8341114d300b9089b3a80816fbcd24 (diff) |
Added mastodon shortcode (#8)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 3 | ||||
-rw-r--r-- | layouts/partials/mastodon-js.html | 3 | ||||
-rw-r--r-- | layouts/shortcodes/mastodon.html | 9 |
3 files changed, 14 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 19302ce..8e684cf 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,7 +14,8 @@ {{ partial "bootstrap-js.html" . }} {{ partial "google-analytics-async.html" . }} + {{ partial "mastodon-js.html" . }} {{ partial "cookie-consent.html" . }} </body> -</html>
\ No newline at end of file +</html> diff --git a/layouts/partials/mastodon-js.html b/layouts/partials/mastodon-js.html new file mode 100644 index 0000000..ac77131 --- /dev/null +++ b/layouts/partials/mastodon-js.html @@ -0,0 +1,3 @@ +{{ if ($.Page.Scratch.Get "include_mastodon") "true" }} +<script src="https://mastodon.social/embed.js" async="async"></script> +{{ end }} diff --git a/layouts/shortcodes/mastodon.html b/layouts/shortcodes/mastodon.html new file mode 100644 index 0000000..71060e0 --- /dev/null +++ b/layouts/shortcodes/mastodon.html @@ -0,0 +1,9 @@ +{{ .Page.Scratch.Set "include_mastodon" true }} +{{ $width := .Get "width" | default "400" }} +{{ $height := .Get "height" | default "333"}} +{{ $status := .Get "status" | default "false" }} + +{{ if eq ($status) "false" }} +{{ else }} +<iframe src= "{{ $status }}/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="{{ $width }}" height="{{ $height }}"></iframe> +{{ end }}
\ No newline at end of file |