mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-24 00:56:34 -05:00
Added shortcode for displaying mastodon toots
This commit is contained in:
parent
599181ab1c
commit
e84c4d43ec
1 changed files with 36 additions and 0 deletions
36
layouts/shortcodes/displayToots.html
Normal file
36
layouts/shortcodes/displayToots.html
Normal file
|
@ -0,0 +1,36 @@
|
|||
{{ $suburl := .Get 0 }}
|
||||
{{ $url := print .Site.BaseURL $suburl}}
|
||||
{{ $dataJ := getJSON $url }}
|
||||
|
||||
<style>
|
||||
.toot {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.toot .e-content img {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.toot .e-content p:first-of-type {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
{{ range $dataJ }}
|
||||
{{ if ne .content "" }}
|
||||
<article class="toot h-entry">
|
||||
<div>
|
||||
<div class="e-content">
|
||||
<img width=50 src="{{ .account.avatar }}"/>
|
||||
{{ .content | safeHTML }}
|
||||
</div>
|
||||
</div>
|
||||
<div class=".toot-social">
|
||||
<span><i class='fas fa-share'></i> {{ .replies_count }} </span>
|
||||
<span><i class='fas fa-retweet'></i> {{ .reblogs_count }} </span>
|
||||
<span><i class='fas fa-star'></i> {{ .favourites_count }} </span>
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
Loading…
Reference in a new issue