From 1bd94c5f7a9c57dc2460afdf84597ea78c69d4b6 Mon Sep 17 00:00:00 2001 From: Huy Tran Date: Sun, 23 Sep 2018 09:50:55 +1000 Subject: [PATCH] Revert "replace to work with Hugo before 0.48 #40" This reverts commit 3510227568e93f3cc387b95422f59f6fe2f17603. revert changes --- layouts/partials/highlight-js.html | 11 +++++------ layouts/shortcodes/fig.html | 11 ++++++----- 2 files changed, 11 insertions(+), 11 deletions(-) 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"}}