From 69eb3014056f0594a16a0417d8cd6b3b4cfc3750 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sun, 15 May 2022 20:37:52 -0400 Subject: [PATCH] Added shortcode to display local toot --- layouts/shortcodes/displayToot.html | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 layouts/shortcodes/displayToot.html diff --git a/layouts/shortcodes/displayToot.html b/layouts/shortcodes/displayToot.html new file mode 100644 index 0000000..47b05c4 --- /dev/null +++ b/layouts/shortcodes/displayToot.html @@ -0,0 +1,30 @@ +{{ $toot_reference := .Get 0 }} +{{ $url := printf "static/data/toots/%s.json" $toot_reference }} +{{ $dataJ := getJSON $url }} + +{{ with $dataJ }} +{{ if ne .content "" }} +
+
+ +

Tooted on

+ {{ .content | safeHTML }} + {{ if gt (len .media_attachments) 0 }} +
+ {{ range .media_attachments}} + {{ if eq .type "image" }} + {{ .description }} + {{ end }} + {{ end }} +
+ {{ end }} +
+
+ {{ .replies_count }} + {{ .reblogs_count }} + {{ .favourites_count }} + | Source: {{ .url }} +
+
+{{ end }} +{{ end }}