layouts/shortcodes/activity.html (view raw)
1<h3 style="margin-top:2rem">Activité récente</h3>
2<div class="activity-grid">
3 <h4>Dernière publication</h4>
4 <div>
5 {{ range first 1 (where site.RegularPages "Section" "posts") }}
6 <a href="{{ .RelPermalink }}">{{ .LinkTitle }} <span class='date'>{{ .Date | time.Format "02.01.06" }}</span></a>
7 {{end}}
8 </div>
9
10 <h4>Dernier tuto</h4>
11 <div>
12 {{ range first 1 (where site.RegularPages "Section" "tutos") }}
13 <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
14 {{end}}
15 </div>
16
17 <h4>Lecture en cours</h4>
18 <div>
19 {{ $outbox := dict }}
20 {{ with resources.GetRemote "https://bookwyrm.social/user/5ika/outbox?page=1" }}
21 {{ with .Err }}
22 {{ errorf "%s" . }}
23 {{ else }}
24 {{ $outbox = . | transform.Unmarshal }}
25 {{ with index $outbox.orderedItems 0 }}
26 <a href='{{ .id }}' target="_blank">
27 {{ with index .attachment 0 }}
28 {{ .name }}
29 {{ end }}
30 </a>
31 {{ end }}
32 {{ end }}
33 {{ end }}
34 </div>
35</div>