Adding HTML5 audio (using image markdown)

This commit is contained in:
Sean Dockray 2020-09-05 23:25:42 +10:00
parent a11a7f791c
commit e920fbfaf4
1 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,15 @@
{{- else -}} {{- else -}}
<a href="{{- $t_destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{- $t_destination -}} not found</span></a> <a href="{{- $t_destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">topic:{{- $t_destination -}} not found</span></a>
{{- end -}} {{- end -}}
{{- else if strings.HasPrefix .Destination "audio:" -}}
{{- $a_destination := (substr .Destination 6) -}}
{{- if findRE "^.*static" $a_destination -}}
<div>{{ .Text }}</div>
<audio src="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}" preload="metadata" controls="true"></audio>
{{- else -}}
<div>{{ .Text }}</div>
<audio src="{{- $a_destination | safeURL -}}" preload="metadata" controls="true"></audio>
{{- end -}}
{{- else if findRE "^.*static" .Destination -}} {{- else if findRE "^.*static" .Destination -}}
<img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} /> <img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
{{- else -}} {{- else -}}