mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-12-22 18:35:41 +00:00
shortcodes: audio (#9)
This commit is contained in:
parent
ea75958a39
commit
90c8df3121
19
layouts/shortcodes/audio.html
Normal file
19
layouts/shortcodes/audio.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{{ $src := .Get 0 }}
|
||||
{{ $split_src := split $src "." }}
|
||||
{{ $extension := index $split_src (sub (len $split_src) 1) }}
|
||||
|
||||
<audio preload="auto" controls>
|
||||
{{ if eq $extension "ogg" }}
|
||||
<source src="{{ $src }}" type="audio/ogg">
|
||||
Your browser doesn't support Ogg Vorbis audio. :(
|
||||
<a href="{{ $src }}">Download the audio instead</a>
|
||||
{{ else if eq $extension "mp3" }}
|
||||
<source src="{{ $src }}" type="audio/mpeg">
|
||||
<a href="{{ $src }}">Download the audio instead</a>
|
||||
{{ else if eq $extension "wav" }}
|
||||
<source src="{{ $src }}" type="audio/wav">
|
||||
<a href="{{ $src }}">Download the audio instead</a>
|
||||
{{ else }}
|
||||
<a href="{{ $src }}">Download the audio instead</a>
|
||||
{{ end }}
|
||||
</audio>
|
Loading…
Reference in a new issue