1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul-website synced 2024-12-21 23:12:19 +00:00
strimertul-website/layouts/shortcodes/release-dl.html
Ash Keel d20ea4b735
All checks were successful
continuous-integration/drone/push Build is passing
rel notes
2023-11-12 03:24:21 +01:00

29 lines
798 B
HTML

{{ $url := .Get 0 }}
{{ $files := getJSON $url }}
{{ with .Page.Params.downloads }}
<table class="downloads">
<tbody>
{{ range . }}
{{ $filename := index (split .url "/") (sub (len (split .url "/")) 1) }}
{{ $record := where $files "name" $filename | first 1 }}
{{ $target := .target }}
{{ range $record }}
<tr>
<th>{{ $target }}</th>
<td>
<a href="{{ .url }}">{{ .name }}</a>
({{ printf "%.2f" (div .size 1e6) }} MiB)
</td>
</tr>
{{ else }}
<tr>
<th>{{ .target }}</th>
<td>
<a href="{{ .url }}">{{ .name }}</a>
</td>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
{{ end }}