mirror of
https://git.sr.ht/~ashkeel/strimertul-website
synced 2024-10-31 21:33:09 +00:00
32 lines
837 B
HTML
32 lines
837 B
HTML
|
{{ $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>
|
||
|
<a href="{{ .url }}"
|
||
|
>{{ .name }} ({{ printf "%.2f" (div .size 1e6) }} MiB)</a
|
||
|
>
|
||
|
</td>
|
||
|
</tr>
|
||
|
{{ else }}
|
||
|
<tr>
|
||
|
<th>{{ .target }}</th>
|
||
|
<td>
|
||
|
<a href="{{ .url }}">{{ .name }}</a>
|
||
|
</td>
|
||
|
</tr>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
{{ end }}
|