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