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

42 lines
1.5 KiB
HTML

{{ define "main" }}
<h2>{{ .Title }}</h2>
<hr>
{{ .Content }}
{{ $art := (index site.Data ($.Param "json")) }}
{{ $newgrounds_icon := resources.Get "newgrounds.webp" }}
{{ range $art.categories }}
{{ $.Scratch.Set "header-type" "h3" }}
{{ $.Scratch.Set "header-name" .name }}
{{ partial "fake-heading.html" $ }}
<p>{{ .description }}</p>
{{ range sort .years "year" "desc" }}
{{ $.Scratch.Set "header-type" "h4" }}
{{ $.Scratch.Set "header-name" .year}}
{{ partial "fake-heading.html" $ }}
<div class="gallery">
{{ range .pieces }}
<figure>
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
<audio controls src="{{ $full.RelPermalink }}" preload="metadata">
Your browser does not support audio.
</audio>
<figcaption>
"{{ .title }}"
{{ if .newgrounds_url }}
<a href="{{ .newgrounds_url }}" style="vertical-align: bottom"><img style="vertical-align: bottom" alt="Newgrounds Icon" width="19" height="19" src="{{ $newgrounds_icon.RelPermalink }}"></a>
{{ end }}
</figcaption>
</figure>
{{ end }}
</div>
{{ end }}
{{ end }}
{{ end }}