all repos — blog @ main

Code and content for 5ika.ch

layouts/shortcodes/books.html (view raw)

 1<div style="margin-top:2rem">
 2    {{ $outbox := dict }}
 3    {{ with resources.GetRemote "https://bookwyrm.social/user/5ika/outbox?page=1" }}
 4            {{ $outbox = . | transform.Unmarshal }}
 5            {{ range $outbox.orderedItems }}
 6                {{ if hasPrefix .content "<p>" }}
 7                    <div>
 8                        <a href='{{ .inReplyToBook }}' target="_blank">
 9                            {{ with index .attachment 0 }}
10                                {{ (replaceRE ` \(.*?\)` "" (replaceRE `^(.*):` "<strong>$1</strong>" .name)) | safeHTML }}
11                            {{ end}}
12                        </a>
13                        <div style="margin-top:8px"><span class='date'>{{ dateFormat "2 Jan 2006"  .published }}</span></div>
14                        <blockquote>{{ (replaceRE `<p>\(comment on .*</p>` "" .content) | safeHTML}}</blockquote>
15                    </div>
16            {{ end }}
17        {{ end }}
18    {{ end }}
19</div>