From 0cefeeb2705bd2572d99c973f384f9a655367cb6 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sun, 15 May 2022 22:11:38 -0400 Subject: [PATCH] Added links to social buttons on toots --- layouts/shortcodes/displayOnlineToot.html | 58 ++++++++++++------ layouts/shortcodes/displayToot.html | 58 ++++++++++++------ layouts/shortcodes/displayToots.html | 58 ++++++++++++------ layouts/toots/list.html | 21 ++++++- layouts/toots/single.html | 71 ++++++++++++++--------- 5 files changed, 181 insertions(+), 85 deletions(-) diff --git a/layouts/shortcodes/displayOnlineToot.html b/layouts/shortcodes/displayOnlineToot.html index 67b9b46..5584190 100644 --- a/layouts/shortcodes/displayOnlineToot.html +++ b/layouts/shortcodes/displayOnlineToot.html @@ -6,26 +6,48 @@ {{ 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 }} + +

Tooted on

+
+ {{ .content | safeHTML }} + {{ if gt (len .media_attachments) 0 }} +
+ {{ range .media_attachments}} + {{ if eq .type "image" }} + {{ .description }} + {{ end }} + {{ end }} +
+ {{ end }} +
+ + {{ range .tags }} + + {{ end }}
- {{ .replies_count }} - {{ .reblogs_count }} - {{ .favourites_count }} - | Source: {{ .url }} + {{ $post_url := urls.Parse .url }} + {{ $status_id := index (last 1 (split $post_url.Path "/")) 0 }} + {{ $social_url := printf "%s://%s/interact/%s" $post_url.Scheme $post_url.Host $status_id }} + {{ $reply_url := printf "%s?type=reply" $social_url }} + {{ $favorite_url := printf "%s?type=favourite" $social_url }} + {{ $boost_url := printf "%s?type=reblog" $social_url }} + + + {{ .Params.replies_count }} + + + + {{ .Params.reblogs_count }} + + + + {{ .Params.favourites_count }} + + | Source: {{ .url }}
-
+ {{ end }} {{ end }} diff --git a/layouts/shortcodes/displayToot.html b/layouts/shortcodes/displayToot.html index 47b05c4..29e4e30 100644 --- a/layouts/shortcodes/displayToot.html +++ b/layouts/shortcodes/displayToot.html @@ -5,26 +5,48 @@ {{ 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 }} + +

Tooted on

+
+ {{ .content | safeHTML }} + {{ if gt (len .media_attachments) 0 }} +
+ {{ range .media_attachments}} + {{ if eq .type "image" }} + {{ .description }} + {{ end }} + {{ end }} +
+ {{ end }} +
+ + {{ range .tags }} + + {{ end }}
- {{ .replies_count }} - {{ .reblogs_count }} - {{ .favourites_count }} - | Source: {{ .url }} + {{ $post_url := urls.Parse .url }} + {{ $status_id := index (last 1 (split $post_url.Path "/")) 0 }} + {{ $social_url := printf "%s://%s/interact/%s" $post_url.Scheme $post_url.Host $status_id }} + {{ $reply_url := printf "%s?type=reply" $social_url }} + {{ $favorite_url := printf "%s?type=favourite" $social_url }} + {{ $boost_url := printf "%s?type=reblog" $social_url }} + + + {{ .Params.replies_count }} + + + + {{ .Params.reblogs_count }} + + + + {{ .Params.favourites_count }} + + | Source: {{ .url }}
-
+ {{ end }} {{ end }} diff --git a/layouts/shortcodes/displayToots.html b/layouts/shortcodes/displayToots.html index f34a188..7fd6378 100644 --- a/layouts/shortcodes/displayToots.html +++ b/layouts/shortcodes/displayToots.html @@ -5,26 +5,48 @@ {{ range sort $dataJ "created_at" "desc" }} {{ if ne .content "" }}
-
- -

Tooted on

- {{ .content | safeHTML }} - {{ if gt (len .media_attachments) 0 }} -
- {{ range .media_attachments}} - {{ if eq .type "image" }} - {{ .description }} - {{ end }} - {{ end }} -
- {{ end }} + +

Tooted on

+
+ {{ .content | safeHTML }} + {{ if gt (len .media_attachments) 0 }} +
+ {{ range .media_attachments}} + {{ if eq .type "image" }} + {{ .description }} + {{ end }} + {{ end }} +
+ {{ end }} +
+ + {{ range .tags }} + + {{ end }}
- {{ .replies_count }} - {{ .reblogs_count }} - {{ .favourites_count }} - | Source: {{ .url }} + {{ $post_url := urls.Parse .url }} + {{ $status_id := index (last 1 (split $post_url.Path "/")) 0 }} + {{ $social_url := printf "%s://%s/interact/%s" $post_url.Scheme $post_url.Host $status_id }} + {{ $reply_url := printf "%s?type=reply" $social_url }} + {{ $favorite_url := printf "%s?type=favourite" $social_url }} + {{ $boost_url := printf "%s?type=reblog" $social_url }} + + + {{ .Params.replies_count }} + + + + {{ .Params.reblogs_count }} + + + + {{ .Params.favourites_count }} + + | Source: {{ .url }}
-
+ {{ end }} {{ end }} diff --git a/layouts/toots/list.html b/layouts/toots/list.html index d26a543..71104f5 100644 --- a/layouts/toots/list.html +++ b/layouts/toots/list.html @@ -35,9 +35,24 @@ {{ end }}
- {{ .Params.replies_count }} - {{ .Params.reblogs_count }} - {{ .Params.favourites_count }} + {{ $post_url := urls.Parse .Params.syndication }} + {{ $status_id := index (last 1 (split $post_url.Path "/")) 0 }} + {{ $social_url := printf "%s://%s/interact/%s" $post_url.Scheme $post_url.Host $status_id }} + {{ $reply_url := printf "%s?type=reply" $social_url }} + {{ $favorite_url := printf "%s?type=favourite" $social_url }} + {{ $boost_url := printf "%s?type=reblog" $social_url }} + + + {{ .Params.replies_count }} + + + + {{ .Params.reblogs_count }} + + + + {{ .Params.favourites_count }} + | Source: {{ .Params.syndication }}
diff --git a/layouts/toots/single.html b/layouts/toots/single.html index 451d647..7fc0ab0 100644 --- a/layouts/toots/single.html +++ b/layouts/toots/single.html @@ -4,35 +4,50 @@ {{ .Scratch.Set "customTitleHeaderLink" "/toots" }} {{ partial "header.html" . }}
-
- -

Tooted on

-
- {{ .Content | safeHTML }} - {{ if gt (len .Params.media_attachments) 0 }} -
- {{ range .Params.media_attachments}} - {{ if eq .type "image" }} - {{ .description }} - {{ end }} - {{ end }} -
- {{ end }} -
- - {{ range .Params.tags }} - +
+ +

Tooted on

+
+ {{ .Content | safeHTML }} + {{ if gt (len .Params.media_attachments) 0 }} +
+ {{ range .Params.media_attachments}} + {{ if eq .type "image" }} + {{ .description }} {{ end }} -
- {{ .Params.replies_count }} - {{ .Params.reblogs_count }} - {{ .Params.favourites_count }} - | Source: {{ .Params.syndication }} -
-
+ {{ end }} + + {{ end }} + + + {{ range .Params.tags }} + + {{ end }} +
+ {{ $post_url := urls.Parse .Params.syndication }} + {{ $status_id := index (last 1 (split $post_url.Path "/")) 0 }} + {{ $social_url := printf "%s://%s/interact/%s" $post_url.Scheme $post_url.Host $status_id }} + {{ $reply_url := printf "%s?type=reply" $social_url }} + {{ $favorite_url := printf "%s?type=favourite" $social_url }} + {{ $boost_url := printf "%s?type=reblog" $social_url }} + + + {{ .Params.replies_count }} + + + + {{ .Params.reblogs_count }} + + + + {{ .Params.favourites_count }} + + | Source: {{ .Params.syndication }} +
+
{{ partial "footer.html" . }} {{ end }}