add asset bundling, cache busting and fingerprinting to css and js

This commit is contained in:
Patrick Favre-Bulle 2022-12-29 23:23:24 +01:00
parent d54665763d
commit 6802a82d0d
No known key found for this signature in database
GPG key ID: 95A396FCC7E8EE9F
9 changed files with 2590 additions and 5 deletions

View file

@ -7,11 +7,16 @@
{{- partial "footer.html" . -}}
<!-- We do need jQuery to be loaded before HugoScroll script -->
<script type="text/javascript" src='{{ "js/jquery-3.6.0.min.js" | absURL }}'></script>
{{ $scriptJquery := resources.Get "js/jquery-3.6.0.min.js" }}
<!-- The main JavaScript files for HugoScroll -->
<script type="text/javascript" src='{{ "js/icons.js" | absURL }}'></script>
<script type="text/javascript" src='{{ "js/index.js" |absURL }}'></script>
{{ $scriptIcons := resources.Get "js/icons.js" }}
{{ $scriptIndex := resources.Get "js/index.js" }}
{{ $js := slice $scriptJquery $scriptIcons $scriptIndex | resources.Concat "js/script.js" | resources.Minify | resources.Fingerprint }}
<script type="text/javascript" src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}" ></script>
<!-- A partial to be overwritten by the user.
Simply place a custom_body.html into
your local /layouts/partials-directory -->