From c4ce90ce987a0f93fd2a4c70f1d42886cdb34534 Mon Sep 17 00:00:00 2001
From: Blake Gearin <blakegearin@pm.me>
Date: Mon, 04 Apr 2022 01:07:04 +0000
Subject: [PATCH] Add custom SASS and JS support
---
layouts/partials/scripts/bundle.html | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/layouts/partials/scripts/bundle.html b/layouts/partials/scripts/bundle.html
index e144389..332eeab 100644
--- a/layouts/partials/scripts/bundle.html
+++ b/layouts/partials/scripts/bundle.html
@@ -16,7 +16,13 @@
{{- $mainScriptPath := "js/index.js" }}
{{- $main := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . }}
-{{- $bundle := slice $variables $functions $code $main $fuse $search | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
+{{- $customScriptPath := "js/custom.js" }}
+{{ if (fileExists "../../assets/js/custom.js") }}
+ {{ $customScriptPath := "../../assets/js/custom.js" }}
+{{ end }}
+{{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }}
+
+{{- $bundle := slice $variables $functions $code $main $fuse $search $custom | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
<script src="{{ $bundle.Permalink }}"></script>
{{- partialCached "hooks/scripts" . -}}
--
Gitblit v1.10.0