diff --git a/layouts/partials/highlight-js.html b/layouts/partials/highlight-js.html index 09d7bc3..c8cafd7 100644 --- a/layouts/partials/highlight-js.html +++ b/layouts/partials/highlight-js.html @@ -1,19 +1,18 @@ {{ if .Site.Params.highlightjs }} {{ if or (not (isset .Params "highlight")) (.Params.highlight) }} - {{ .Scratch.Set "hl_languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }} + {{ $hl := newScratch }} + {{ $hl.Set "languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }} - {{ with .Scratch.Get "hl_languages" }} + {{ with $hl.Get "languages" }} {{ range . }} {{ end }} {{ end }} - {{ .Scratch.Delete "hl_languages" }} + {{ $hl.Delete "languages" }} {{ end }} {{ end }} diff --git a/layouts/shortcodes/fig.html b/layouts/shortcodes/fig.html index 6d7002f..54bd8ca 100644 --- a/layouts/shortcodes/fig.html +++ b/layouts/shortcodes/fig.html @@ -1,7 +1,8 @@ +{{ $fig := newScratch }} {{ if .Get "caption" }} - {{ $.Scratch.Set "caption" (.Get "caption") }} + {{ $fig.Set "caption" (.Get "caption") }} {{ else if .Get "alt" }} - {{ $.Scratch.Set "caption" (.Get "alt") }} + {{ $fig.Set "caption" (.Get "alt") }} {{ end }} {{ $permalink := $.Page.Permalink }} @@ -28,10 +29,10 @@ /> {{ if .Get "link"}}{{ end }} - {{ if ($.Scratch.Get "caption") }} + {{ if ($fig.Get "caption") }}
- Figure {{ $.Page.Scratch.Get "fig" }}. {{ $.Scratch.Get "caption" | markdownify | plainify }} + Figure {{ $.Page.Scratch.Get "fig" }}. {{ $fig.Get "caption" | markdownify | plainify }} {{ if .Get "attr" }} [{{- with .Get "attrlink"}}{{ end }}{{ .Get "attr" | markdownify }}{{ if .Get "attrlink"}}{{ end -}}] {{ end }} @@ -40,4 +41,4 @@ {{ end }} {{ .Page.Scratch.Add "fig" 1 }} -{{ $.Scratch.Delete "caption"}} +{{ $fig.Delete "caption"}}