hugo-tufte/layouts/shortcodes/marginnote.html

13 lines
533 B
HTML
Raw Normal View History

{{- with $.Page.Scratch.Get "marginnoteCounter" -}}
{{- $.Page.Scratch.Set "marginnoteCounter" (add . 1) -}}
{{- else -}}
{{- $.Page.Scratch.Set "marginnoteCounter" 1 -}}
{{- end -}}
{{- $label := $.Page.Scratch.Get "marginnoteCounter" -}}
2023-04-15 16:31:10 +02:00
{{- $ind := .Get "ind" | default .Site.Params.marginNoteInd -}}
2023-04-18 01:29:12 +02:00
<label for="marginnote-{{ $label }}" class="margin-toggle marginnote-ind">{{ $ind }}</label>
<input type="checkbox" id="marginnote-{{ $label }}" class="margin-toggle"/>
2023-04-15 16:31:10 +02:00
<span class="marginnote">
{{ .Inner | markdownify}}
</span>