From 197d8cf2fdde4ac636750ae620d83d30968164ff Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Tue, 28 Feb 2023 14:04:26 +0000
Subject: [PATCH] clean up
---
layouts/partials/scripts/bundle.html | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/layouts/partials/scripts/bundle.html b/layouts/partials/scripts/bundle.html
index b282e40..ef15f36 100644
--- a/layouts/partials/scripts/bundle.html
+++ b/layouts/partials/scripts/bundle.html
@@ -5,9 +5,10 @@
{{- $main := partial "functions/getScript" (dict "slug" "index") }}
{{- $customScriptPath := "js/custom.js" }}
-{{ if (fileExists "../../assets/js/custom.js") }}
- {{ $customScriptPath := "../../assets/js/custom.js" }}
-{{ end }}
+{{- $customScriptRelPath := "../../assets/js/custom.js" }}
+{{- if (fileExists $customScriptRelPath) }}
+ {{- $customScriptPath = $customScriptRelPath }}
+{{- end }}
{{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }}
{{- partial "scripts/getJsBundle" (dict "scripts" (slice $variables $functions $code $mode $main $custom) "slug" "bundle") }}
@@ -15,8 +16,7 @@
{{- partialCached "scripts/search" . -}}
{{- partialCached "hooks/scripts" . -}}
-{{- $sp := .Site.Params }}
-{{- with $sp.customJS }}
+{{- with site.Params.customJS }}
{{- range . -}}
<script src="{{ . }}" async></script>
{{- end }}
--
Gitblit v1.10.0