From 073456b6757a6b18d3552293f791b86d90548c55 Mon Sep 17 00:00:00 2001 From: Evgeny Kuznetsov Date: Sat, 4 Apr 2020 08:59:41 +0300 Subject: [PATCH 1/2] fix hightlight-js partial Inline script should not be inserted on page if site-level highlightjs setting is false. --- layouts/partials/highlight-js.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/highlight-js.html b/layouts/partials/highlight-js.html index 87c347d..93495f1 100644 --- a/layouts/partials/highlight-js.html +++ b/layouts/partials/highlight-js.html @@ -1,13 +1,12 @@ +{{- if (.Site.Params.highlightjs) -}} {{ if or ((not (isset .Params "highlight")) and ((isset .Params "highlight") .Params.highlight)) }} {{ $.Scratch.Set "hl_languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }} - {{ if (.Site.Params.highlightjs) }} - + {{ with $.Scratch.Get "hl_languages" }} {{ range . }} {{ end }} {{ end }} - {{ end }} {{ $.Scratch.Delete "hl_languages" }} {{ end }} +{{- end -}} From 1d9930828145535b641d5548d77dc344977561a9 Mon Sep 17 00:00:00 2001 From: Evgeny Kuznetsov Date: Thu, 4 Jun 2020 09:15:54 +0300 Subject: [PATCH 2/2] fix #122 --- layouts/partials/highlight-js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/highlight-js.html b/layouts/partials/highlight-js.html index 93495f1..450bb88 100644 --- a/layouts/partials/highlight-js.html +++ b/layouts/partials/highlight-js.html @@ -1,5 +1,5 @@ {{- if (.Site.Params.highlightjs) -}} -{{ if or ((not (isset .Params "highlight")) and ((isset .Params "highlight") .Params.highlight)) }} +{{ if or (not (isset .Params "highlight")) (and (isset .Params "highlight") .Params.highlight) }} {{ $.Scratch.Set "hl_languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }} {{ with $.Scratch.Get "hl_languages" }}