From 263ec827c747d01590eadd9db242959ff04961a0 Mon Sep 17 00:00:00 2001 From: loikein Date: Tue, 25 Apr 2023 18:57:16 +0100 Subject: [PATCH] use scratch method for marginnote as well --- layouts/shortcodes/marginnote.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/marginnote.html b/layouts/shortcodes/marginnote.html index 97baf92..71b3c64 100644 --- a/layouts/shortcodes/marginnote.html +++ b/layouts/shortcodes/marginnote.html @@ -1,4 +1,9 @@ -{{- $label := (add .Ordinal 1) -}} +{{- with $.Page.Scratch.Get "marginnoteCounter" -}} +{{- $.Page.Scratch.Set "marginnoteCounter" (add . 1) -}} +{{- else -}} +{{- $.Page.Scratch.Set "marginnoteCounter" 1 -}} +{{- end -}} +{{- $label := $.Page.Scratch.Get "marginnoteCounter" -}} {{- $ind := .Get "ind" | default .Site.Params.marginNoteInd -}}