1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00
seirdy.one/layouts/shortcodes/transcribed-image-transcript.html
Rohan Kumar a8057aa8e8
Add support for <audio> elements
- Adjust transcript shortcodes to also support <audio> elements.
- Add audio element shortcode based on <picture> shortcode
- Make <audio> elements match container width.
2022-06-30 20:12:06 -07:00

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>