1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul-website synced 2024-11-21 21:22:21 +00:00
strimertul-website/layouts/shortcodes/release-dl.html

31 lines
819 B
HTML
Raw Normal View History

2023-11-12 02:14:55 +00:00
{{ $url := .Get 0 }}
{{ $files := getJSON $url }}
{{ with .Page.Params.downloads }}
<h2>Downloads</h2>
<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>
2023-11-12 02:17:11 +00:00
<a href="{{ .url }}">{{ .name }}</a>
({{ printf "%.2f" (div .size 1e6) }} MiB)
2023-11-12 02:14:55 +00:00
</td>
</tr>
{{ else }}
<tr>
<th>{{ .target }}</th>
<td>
<a href="{{ .url }}">{{ .name }}</a>
</td>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
{{ end }}