mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-05 01:12:11 +00:00
a8057aa8e8
- Adjust transcript shortcodes to also support <audio> elements. - Add audio element shortcode based on <picture> shortcode - Make <audio> elements match container width.
26 lines
705 B
HTML
26 lines
705 B
HTML
{{- $captionType := "embeddedTextCaption" -}}
|
|
{{- $type := "image" -}}
|
|
{{- with .Get "type" -}}
|
|
{{- $type = . -}}
|
|
{{- end -}}
|
|
{{ with .Parent -}}
|
|
{{- with .Get "type" -}}
|
|
{{- $type = . -}}
|
|
{{- end -}}
|
|
{{- if eq .Name "transcribed-audio" -}}
|
|
{{- $captionType = "transcript" -}}
|
|
{{- end -}}
|
|
<details>
|
|
<summary>Toggle {{ $type }} <span itemprop="accessibilityFeature">transcript</span></summary>
|
|
<section id="transcript-{{ .Get "id" }}">
|
|
{{ if eq (.Get "hlevel") "3" -}}
|
|
<h4>{{ $type | humanize }} transcript</h4>
|
|
{{- else -}}
|
|
<h5>{{ $type | humanize }} transcript</h5>
|
|
{{- end -}}
|
|
{{- end }}
|
|
<div itemprop="{{ $captionType }}">
|
|
{{ .Inner | markdownify | safeHTML }}
|
|
</div>
|
|
</section>
|
|
</details>
|