1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-20 04:12:09 +00:00
seirdy.one/layouts/shortcodes/codefigure.html
Rohan Kumar c26a6d6cc8
Re-introduce conservative minificaiton
- Don't auto-minify HTML but minify other resources, inc. the RSS feed
- Manually optimize whitespace a little to balance readability and
  compressed size
2022-04-26 17:15:42 -07:00

12 lines
434 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>