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

2573
assets/css/fork-awesome.css Normal file

File diff suppressed because it is too large Load diff

2
assets/js/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

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 -->

View file

@ -19,8 +19,13 @@
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="{{ "css/screen.css" | absURL }}" />
<link rel="stylesheet" href="{{ "css/fonts.css" | absURL }}" type="text/css" />
{{ $stylesheetNormalize := resources.Get "css/normalize.css" }}
{{ $stylesheetFonts := resources.Get "css/fonts.css" }}
{{ $stylesheetScreen := resources.Get "css/screen.css" }}
{{ $stylesheet := slice $stylesheetNormalize $stylesheetFonts $stylesheetScreen | resources.Concat "css/style.css" | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $stylesheet.Permalink }}" type="text/css" integrity="{{ $stylesheet.Data.Integrity }}" />
<link
rel="stylesheet"
href="{{ "fork-awesome/css/fork-awesome.min.css" | absURL }}"