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

27 lines
705 B
HTML
Raw Permalink 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>