hugo-tufte/layouts/shortcodes/sidenote.html
2023-04-29 05:17:50 +01:00

11 lines
558 B
HTML

{{- with $.Page.Scratch.Get "sidenoteCounter" -}}
{{- $.Page.Scratch.Set "sidenoteCounter" (add . 1) -}}
{{- else -}}
{{- $.Page.Scratch.Set "sidenoteCounter" 1 -}}
{{- end -}}
{{- $label := $.Page.Scratch.Get "sidenoteCounter" -}}
<label for="sidenote-{{ $label }}" class="margin-toggle sidenote-number">({{ $label }})</label>
<input type="checkbox" id="sidenote-{{ $label }}" class="margin-toggle"/>
<span class="sidenote"{{ with .Get "lang" }} lang="{{ . }}"{{ end }}>
<span class="sidenote-number">({{ $label }})</span>{{ .Inner | markdownify }}
</span>