diff options
author | Blake Gearin <blakegearin@pm.me> | 2022-04-04 00:02:45 +0300 |
---|---|---|
committer | weru <16350351+onweru@users.noreply.github.com> | 2022-04-04 04:07:04 +0300 |
commit | c4ce90ce987a0f93fd2a4c70f1d42886cdb34534 (patch) | |
tree | d3f877bb7dc9cefdfae8135c1b23012f76a814cb /layouts/partials/scripts/bundle.html | |
parent | fa302c191e1e9f49aad43cd9bd895455b17c7ca8 (diff) |
Add custom SASS and JS support
Diffstat (limited to 'layouts/partials/scripts/bundle.html')
-rw-r--r-- | 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" . -}} |