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 -}}