Add option to offset a sidenote to prevent overlap

This commit is contained in:
Danila Fedorin 2022-12-09 15:36:07 -08:00
parent fb7910c0a2
commit 2a0f0cad49

View File

@ -1,7 +1,11 @@
<span class="sidenote"> <span class="sidenote">
<label class="sidenote-label" for="{{ .Get 1 }}">{{ .Get 2 }}</label> <label class="sidenote-label" for="{{ .Get 1 }}">{{ .Get 2 }}</label>
<input class="sidenote-checkbox" type="checkbox" id="{{ .Get 1 }}"></input> <input class="sidenote-checkbox" type="checkbox" id="{{ .Get 1 }}"></input>
{{ if $offset := .Get 3 }}
<span class="sidenote-content sidenote-{{ .Get 0 }}" style="margin-top: {{ $offset }}rem">
{{ else }}
<span class="sidenote-content sidenote-{{ .Get 0 }}"> <span class="sidenote-content sidenote-{{ .Get 0 }}">
{{ end }}
<span class="sidenote-delimiter">[note:</span> <span class="sidenote-delimiter">[note:</span>
{{ .Inner }} {{ .Inner }}
<span class="sidenote-delimiter">]</span> <span class="sidenote-delimiter">]</span>