adds audio shortcode
This commit is contained in:
parent
25b76a2abc
commit
7f205c23bd
1 changed files with 12 additions and 0 deletions
12
layouts/shortcodes/audio.html
Normal file
12
layouts/shortcodes/audio.html
Normal 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>
|
Loading…
Reference in a new issue