29 lines
874 B
HTML
29 lines
874 B
HTML
{{/* Source: https://gitlab.com/Roneo/hugo-shortcode-roneo-collection */}}
|
|
|
|
{{- $src := "" -}}
|
|
{{- $caption := "" -}}
|
|
{{- $class := "" -}}
|
|
{{- $preload := "" -}}
|
|
|
|
|
|
{{- if .IsNamedParams }}
|
|
{{- $src = .Get "src" -}}
|
|
{{- $caption = .Get "caption" -}}
|
|
{{- $class = .Get "class" -}}
|
|
{{- $preload = .Get "preload" | default "metadata" -}}
|
|
{{- else }}
|
|
{{- $src = .Get 0 -}}
|
|
{{- $caption = .Get 1 -}}
|
|
{{- $class = .Get 2 -}}
|
|
{{- $preload = .Get 3 -}}
|
|
{{- end }}
|
|
|
|
|
|
<figure {{ with $class }}class="{{ . }}"{{ end }}>
|
|
<audio controls class="player" preload="{{ $preload }}">
|
|
{{ with $src }}<source src="{{ . | relURL }}" type="audio/mpeg">{{ end }}
|
|
</audio>
|
|
{{/* <a href="{{ .Get "src" }}" class="button small" download><i class="icon fas fa-download"></i></a> */}}
|
|
{{ with $caption }}<figcaption>{{ . }}</figcaption>{{ end }}
|
|
</figure>
|