Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/onweru/compose.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Gearin <blakegearin@pm.me>2022-04-04 00:02:45 +0300
committerweru <16350351+onweru@users.noreply.github.com>2022-04-04 04:07:04 +0300
commitc4ce90ce987a0f93fd2a4c70f1d42886cdb34534 (patch)
treed3f877bb7dc9cefdfae8135c1b23012f76a814cb /layouts/partials/scripts/bundle.html
parentfa302c191e1e9f49aad43cd9bd895455b17c7ca8 (diff)
Add custom SASS and JS support
Diffstat (limited to 'layouts/partials/scripts/bundle.html')
-rw-r--r--layouts/partials/scripts/bundle.html8
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" . -}}