redstrate.com/themes/red/layouts/_default/audio-gallery.html

36 lines
1.2 KiB
HTML
Raw Normal View History

2022-08-24 10:24:04 -04:00
{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ .Content }}
{{ $art := (index site.Data ($.Param "json")) }}
2022-08-30 12:08:14 -04:00
{{ $newgrounds_icon := resources.Get "newgrounds.png" }}
2022-08-24 10:24:04 -04:00
{{ range $art.categories }}
2022-08-24 10:31:12 -04:00
<h3>{{ .name }}</h3>
2022-08-24 10:24:04 -04:00
<p>{{ .description }}</p>
{{ range sort .years "year" "desc" }}
2022-08-24 10:31:12 -04:00
<h4>{{ .year }}</h4>
2022-08-24 10:24:04 -04:00
<div class="gallery">
{{ range .pieces }}
<figure>
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
2022-08-24 10:28:56 -04:00
<audio controls src="{{ $full.Permalink }}" preload="metadata">
Your browser does not support audio.
2022-08-24 10:24:04 -04:00
</audio>
<figcaption>
"{{ .title }}"
{{ if .newgrounds_url }}
2022-08-30 12:08:14 -04:00
<a href="{{ .newgrounds_url }}"><img alt="Newgrounds Icon" width="16" height="16" src="{{ $newgrounds_icon.Permalink }}"></a>
2022-08-24 10:24:04 -04:00
{{ end }}
</figcaption>
</figure>
{{ end }}
</div>
{{ end }}
{{ end }}
{{ end }}