fix(template): fix the with function rebinds context issue that result in TypeIt cdn configuration not work.

This commit is contained in:
Fedomn 2020-02-07 12:45:38 +08:00
parent 44222e7d12
commit 4879878de7

View file

@ -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 "<script src=\"%s\"></script>" $res.RelPermalink -}}