1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-25 02:02:11 +00:00
seirdy.one/layouts/shortcodes/transcribed-image-transcript.html

27 lines
705 B
HTML
Raw Normal View History

{{- $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>