hugo-tufte/layouts/shortcodes/sidenote.html

12 lines
582 B
HTML
Raw Normal View History

{{- with $.Page.Scratch.Get "sidenoteCounter" -}}
{{- $.Page.Scratch.Set "sidenoteCounter" (add . 1) -}}
{{- else -}}
{{- $.Page.Scratch.Set "sidenoteCounter" 1 -}}
{{- end -}}
2023-04-15 16:31:10 +02:00
{{- $sidenoteDomIdSuffix := $.Page.Scratch.Get "sidenoteCounter" -}}
<label for="sidenote-{{ $sidenoteDomIdSuffix }}" class="margin-toggle sidenote-number">({{ $sidenoteDomIdSuffix }})</label>
<input type="checkbox" id="sidenote-{{ $sidenoteDomIdSuffix }}" class="margin-toggle"/>
<span class="sidenote">
2023-04-15 16:31:10 +02:00
<span class="sidenote-number">({{ $sidenoteDomIdSuffix }})</span>{{ .Inner | markdownify }}
</span>