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/codefigure.html
Rohan Kumar 01e52bad16
Split up figcaption partial, add some fignos
- give code blocks their own figure numbers/names/ID
- Split figcaption into quotecaption and codecaption
- create codefigure partial to reduce markup for SoftwareSourceCode
  figures
2022-04-19 18:06:57 -07:00

10 lines
270 B
HTML

{{ $codeIndex := .Page.Scratch.Get "codeIndex" }}
{{ $id := .Get "id" }}
<figure itemscope itemtype="https://schema.org/SoftwareSourceCode"
{{ if $id }}
id="{{ $id }}"
{{- else -}}
id="code-{{ sub $codeIndex 1 }}"
{{ end }}>
{{ .Inner | markdownify }}
</figure>