2022-05-15 20:37:37 -04:00
|
|
|
{{ $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 "" }}
|
|
|
|
<article class="toot h-entry">
|
2022-05-15 22:11:38 -04:00
|
|
|
<div rel="author" class="h-card p-author toot-avatar">
|
|
|
|
<img class="u-photo" width=50 src="{{ .account.avatar }}"/>
|
|
|
|
<span style="display: none;">{{ .account.display_name }}</span>
|
|
|
|
</div>
|
|
|
|
<p class="date">Tooted on <time class="dt-published" datetime='{{ .created_at }}'>{{ dateFormat "January 2, 2006 15:04" (time .created_at) }}</time></p>
|
|
|
|
<div class="e-content p-name">
|
|
|
|
{{ .content | safeHTML }}
|
|
|
|
{{ if gt (len .media_attachments) 0 }}
|
|
|
|
<div class="toot-photos">
|
|
|
|
{{ range .media_attachments}}
|
|
|
|
{{ if eq .type "image" }}
|
|
|
|
<img src="{{ .preview_url }}" alt="{{ .description }}"/>
|
2022-05-15 20:37:37 -04:00
|
|
|
{{ end }}
|
2022-05-15 22:11:38 -04:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2022-05-15 20:37:37 -04:00
|
|
|
</div>
|
2022-05-15 22:11:38 -04:00
|
|
|
<a class="u-url" style="display: none">{{ .Permalink }}</a>
|
|
|
|
{{ range .tags }}
|
|
|
|
<a class="p-category" href="{{ .url }}" style="display: none;">{{ .name }}</a>
|
|
|
|
{{ end }}
|
2022-05-15 20:37:37 -04:00
|
|
|
<div class="toot-social">
|
2022-05-15 22:11:38 -04:00
|
|
|
{{ $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 }}
|
|
|
|
<span>
|
|
|
|
<a class='fas fa-share' href="{{ $reply_url }}"></a>
|
2022-05-20 18:10:04 -04:00
|
|
|
{{ .replies_count }}
|
2022-05-15 22:11:38 -04:00
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<a class='fas fa-retweet' href="{{ $boost_url }}"></a>
|
2022-05-20 18:10:04 -04:00
|
|
|
{{ .reblogs_count }}
|
2022-05-15 22:11:38 -04:00
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<a class='fas fa-star' href="{{ $favorite_url }}"></a>
|
2022-05-20 18:10:04 -04:00
|
|
|
{{ .favourites_count }}
|
2022-05-15 22:11:38 -04:00
|
|
|
</span>
|
|
|
|
<span>| Source: <a class="u-syndication" href="{{ .url }}">{{ .url }}</a></span>
|
2022-05-15 20:37:37 -04:00
|
|
|
</div>
|
2022-05-15 22:11:38 -04:00
|
|
|
</article>
|
2022-05-15 20:37:37 -04:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|