aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/head.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-05-06 08:16:20 -0400
committertdro <tdro@noreply.example.com>2022-05-06 08:16:20 -0400
commit7f9817200b0e46dc3aca63a7a31de82b6d105e2f (patch)
treef25e551a6007431ef58a710d2dbd0d7220d58d55 /themes/default/layouts/partials/head.html
parent16c09dd5c34743f74319dd41746ec0fe7efb7260 (diff)
downloadcanory-7f9817200b0e46dc3aca63a7a31de82b6d105e2f.tar.gz
canory-7f9817200b0e46dc3aca63a7a31de82b6d105e2f.tar.bz2
canory-7f9817200b0e46dc3aca63a7a31de82b6d105e2f.zip
themes/default/layouts/partials/head: Bundle
Fingerprint and cache bust automatically.
Diffstat (limited to 'themes/default/layouts/partials/head.html')
-rw-r--r--themes/default/layouts/partials/head.html17
1 files changed, 14 insertions, 3 deletions
diff --git a/themes/default/layouts/partials/head.html b/themes/default/layouts/partials/head.html
index e45b5d6..fd04ed0 100644
--- a/themes/default/layouts/partials/head.html
+++ b/themes/default/layouts/partials/head.html
@@ -35,13 +35,24 @@
<!-- Content Security Policy -->
{{- partial "csp.html" . -}}
-<!-- Style Sheets -->
+<!-- Style Sheets & Scripts -->
+{{- if .Site.Params.production -}}
+
+{{- $default := resources.Get "css/default.css" -}}
+{{- $syntax := resources.Get "css/syntax-highlight-default.css" -}}
+{{ $css := slice $default $syntax | resources.Concat "css/bundle.css" | resources.Minify | fingerprint }}
+<link rel="stylesheet" href="{{ $css.Permalink }}">
+{{ $js := resources.Get "js/index.js" | resources.Minify | fingerprint }}
+<script src="{{ $js.Permalink }}"></script>
+
+{{ else }}
+
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/default.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/syntax-highlight-default.css">
-
-<!-- Scripts -->
<script src="{{ .Site.BaseURL }}/js/index.js"></script>
+{{- end -}}
+
<!-- No Scripts -->
<noscript>
<style>