1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00

Give transcripts back their headings

<div> can't be given an accessible name, and a <section> should have a
heading. Sigh.
This commit is contained in:
Rohan Kumar 2022-06-29 21:37:38 -07:00
parent f12a5b4883
commit 22dfabd262
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -1,14 +1,15 @@
{{ with .Parent -}}
{{- $type := "image" -}}
{{- with .Get "type" -}}
{{- $type = . -}}
{{- end -}}
<details>
{{ with .Parent -}}
{{- $type := "image" -}}
{{- with .Get "type" -}}
{{- $type = . -}}
{{- end -}}
<summary><span id="btn-{{ .Get "id" }}">{{ $type | humanize }} <span itemprop="accessibilityFeature">transcript</span></span></summary>
<div id="transcript-{{ .Get "id" }}" aria-labelledby="btn-{{ .Get "id" }}">
{{- end -}}
<div itemprop="embeddedTextCaption">
{{ .Inner | markdownify | safeHTML }}
</div>
<summary>Toggle {{ $type }} <span itemprop="accessibilityFeature">transcript</span></summary>
<section id="transcript-{{ .Get "id" }}">
<h5>{{ $type | humanize }} transcript</h5>
{{- end }}
<div itemprop="embeddedTextCaption">
{{ .Inner | markdownify | safeHTML }}
</div>
</section>
</details>