From a1b9b7dcbd6b019e8d12f7cb01d34e796b4ce940 Mon Sep 17 00:00:00 2001 From: loikein Date: Sat, 15 Apr 2023 15:31:10 +0100 Subject: [PATCH] new features for margin/side note --- layouts/shortcodes/figure.html | 4 ++-- layouts/shortcodes/marginnote.html | 11 +++++++---- layouts/shortcodes/sidenote.html | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 956e8ad..097f5a9 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -16,8 +16,8 @@ {{ if .Get "link" }}{{ end }}
{{ else }}{{/* margin or normal */}} - - + + {{ if eq $type "margin" }} {{ with .Get "link" }}{{ end }} diff --git a/layouts/shortcodes/marginnote.html b/layouts/shortcodes/marginnote.html index 7c11504..fb0e15f 100644 --- a/layouts/shortcodes/marginnote.html +++ b/layouts/shortcodes/marginnote.html @@ -1,4 +1,7 @@ -{{ $marginnoteDomIdSuffix := .Ordinal }} - - -💬 {{ .Inner | markdownify}} +{{- $marginnoteDomIdSuffix := (add .Ordinal 1) -}} +{{- $ind := .Get "ind" | default .Site.Params.marginNoteInd -}} + + + +{{ .Inner | markdownify}} + diff --git a/layouts/shortcodes/sidenote.html b/layouts/shortcodes/sidenote.html index d37f95c..d769229 100644 --- a/layouts/shortcodes/sidenote.html +++ b/layouts/shortcodes/sidenote.html @@ -3,9 +3,9 @@ {{- else -}} {{- $.Page.Scratch.Set "sidenoteCounter" 1 -}} {{- end -}} -{{ $sidenoteDomIdSuffix := $.Page.Scratch.Get "sidenoteCounter" }} +{{- $sidenoteDomIdSuffix := $.Page.Scratch.Get "sidenoteCounter" -}} -({{ $sidenoteDomIdSuffix }}) {{ .Inner | markdownify }} +({{ $sidenoteDomIdSuffix }}){{ .Inner | markdownify }}