mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-17 22:32:10 +00:00
6aa7656411
Causes repetition in some screen readers.
12 lines
433 B
HTML
12 lines
433 B
HTML
{{- $codeIndex := (.Page.Scratch.Get "codeIndex") -}}
|
|
{{- $id := (printf `code-%d` (sub $codeIndex 1)) -}}
|
|
{{- with .Get "id" -}}
|
|
{{- $id = . -}}
|
|
{{- end -}}
|
|
<!--
|
|
The full caption is too long for an aria-label;
|
|
just use the beginning for the label and the full thing for the aria description.
|
|
-->
|
|
<figure aria-labelledby="{{ $id }}" itemscope itemtype="https://schema.org/SoftwareSourceCode">
|
|
{{ .Inner | markdownify }}
|
|
</figure>
|