diff --git a/layouts/shortcodes/displayOnlineToot.html b/layouts/shortcodes/displayOnlineToot.html new file mode 100644 index 0000000..67b9b46 --- /dev/null +++ b/layouts/shortcodes/displayOnlineToot.html @@ -0,0 +1,31 @@ +{{ $url := urls.Parse (.Get 0) }} +{{ $status_id := index (last 1 (split $url.Path "/")) 0 }} +{{ $api_url := printf "%s://%s/api/v1/statuses/%s" $url.Scheme $url.Host $status_id }} +{{ $dataJ := getJSON $api_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 }}