From 4879878de72b5147bd148986f8f0f79b60de922a Mon Sep 17 00:00:00 2001 From: Fedomn Date: Fri, 7 Feb 2020 12:45:38 +0800 Subject: [PATCH] fix(template): fix the with function rebinds context issue that result in TypeIt cdn configuration not work. --- layouts/partials/scripts.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 9b7ca197..30c8a322 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -37,8 +37,8 @@ {{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}} {{- with .Scratch.Get "typeitMap" -}} {{- $typeit := "" -}} - {{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js -}} - {{- $typeit = .Site.Params.cdn.typeit_js -}} + {{- if eq (getenv "HUGO_ENV") "production" | and $.Site.Params.cdn.typeit_js -}} + {{- $typeit = $.Site.Params.cdn.typeit_js -}} {{- else -}} {{- $res := resources.Get "js/lib/typeit/typeit.min.js" -}} {{- $typeit = printf "" $res.RelPermalink -}}