apricote.de/layouts/shortcodes/listory-genres.html

32 lines
948 B
HTML
Raw Normal View History

2023-02-19 17:49:52 +01:00
{{ $listoryApi := getenv "HUGO_LISTORY_HOST" }}{{ $listoryToken := getenv
"HUGO_LISTORY_TOKEN" }} {{ $res := getJSON
"https://listory.apricote.de/api/v1/reports/top-genres?timePreset=last_30_days"
(dict "Authorization" (printf "Bearer %s" $listoryToken) ) }}
<ol>
{{ range first 5 $res.items }}
<li style="margin-bottom: 1em">
<div style="display: flex">
<div style="font-weight: 600; width: 80%">{{ .genre.name | title }}</div>
<div style="width: 20%; text-align: right">
{{ .count }}<img
src="/listen.svg"
style="
height: 1em;
width: 1em;
2023-02-19 17:49:52 +01:00
display: inline;
margin: 0 0;
margin-left: 0.2em;
2023-02-19 17:49:52 +01:00
vertical-align: middle;
"
/>
</div>
</div>
<div style="font-size: 0.9em">
{{ range first 3 .artists }}<code alt="foobar">{{.artist.name}}</code> {{
end }}
</div>
</li>
{{ end }}
</ol>