This commit is contained in:
Danila Fedorin 2022-12-30 13:34:27 -08:00
commit f56465c5ec
3 changed files with 12 additions and 11 deletions

View File

@ -23,5 +23,13 @@
<link rel="stylesheet" href="{{ $code.Permalink }}" media="screen"> <link rel="stylesheet" href="{{ $code.Permalink }}" media="screen">
<link rel="icon" type="image/png" href="{{ $icon.Permalink }}"> <link rel="icon" type="image/png" href="{{ $icon.Permalink }}">
{{ if .Site.IsServer }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css" integrity="sha384-Xi8rHCmBmhbuyyhbI88391ZKP2dmfnOl4rT9ZfRI7mLTdk1wblIUnrIq35nqwEvC" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.js" integrity="sha384-X/XCfMm41VSsqRNQgDerQczD69XqmjOOOwYQvr/uuC+j4OPoNhVgjdGFwhvN02Ja" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
{{ end }}
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
</head> </head>

View File

@ -1,11 +0,0 @@
{{ .Page.Scratch.Add "numbernote-id" 1 }}
{{ $id := .Page.Scratch.Get "numbernote-id" }}
<span class="sidenote">
<label class="sidenote-label" for="numbernote-{{ $id }}">({{ $id }})</label>
<input class="sidenote-checkbox" type="checkbox" id="numbernote-{{ $id }}"></input>
<span class="sidenote-content sidenote-{{ .Get 0 }}">
<span class="sidenote-delimiter">[note:</span>
{{ .Inner }}
<span class="sidenote-delimiter">]</span>
</span>
</span>

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>