adds audio shortcode

This commit is contained in:
Dominic Reich 2024-12-27 06:55:41 +01:00
parent 25b76a2abc
commit 7f205c23bd
Signed by: dominic
GPG key ID: 0B5787DB23049C45

View file

@ -0,0 +1,12 @@
{{- $src := .Get "src" | default (.Get 0) -}} {{- $title := .Get "title" |
default (.Get 1) | default "Shared audio file" }}
<audio controls>
<source src="{{ .Page.Permalink }}{{ $src }}.ogg" type="audio/ogg" />
<source src="{{ .Page.Permalink }}{{ $src }}.mp3" type="audio/mpeg" />
Your browser does not support the audio tag.<br />
We had the following sources:
<a href="{{ .Page.Permalink }}{{ $src }}.ogg">ogg</a>,
<a href="{{ .Page.Permalink }}{{ $src }}.mp3">mp3</a>,
</audio>
<figcaption class="-mt-6 mb-6 text-left">{{ $title }}</figcaption>