From 9cf91340bc0c888342069ad3e8b4f2e2b640c4c3 Mon Sep 17 00:00:00 2001 From: Huy Tran Date: Wed, 15 Aug 2018 07:05:40 +0700 Subject: [PATCH] fixes #27 --- layouts/partials/highlight-js.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/layouts/partials/highlight-js.html b/layouts/partials/highlight-js.html index 1567008..5a0eea9 100644 --- a/layouts/partials/highlight-js.html +++ b/layouts/partials/highlight-js.html @@ -1,12 +1,15 @@ {{ if .Site.Params.highlightjs }} - -{{ with .Site.Params.highlightjslanguages }} -{{ range . }} - -{{ end }} -{{ end }} - + {{ $hl := newScratch }} + {{ $hl.Set "languages" .Site.Params.highlightjslanguages }} + + {{ with $hl.Get "languages" }} + {{ range . }} + + {{ end }} + {{ end }} + + {{ $hl.Delete "languages" }} {{ end }}