From 4a384379cf3116ff53567d101c61ad8d31ccbc72 Mon Sep 17 00:00:00 2001
From: "W.T. Chang" <1546333+wtchangdm@users.noreply.github.com>
Date: Wed, 24 Jul 2024 23:20:57 +0800
Subject: [PATCH 1/4] add hash for jquery
---
layouts/partials/vendor.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/layouts/partials/vendor.html b/layouts/partials/vendor.html
index d1e77f8b..589236ea 100644
--- a/layouts/partials/vendor.html
+++ b/layouts/partials/vendor.html
@@ -1,5 +1,5 @@
{{/* jQuery */}}
-{{ $jqueryLib := resources.Get "lib/jquery/jquery.slim.min.js" }}
+{{ $jqueryLib := resources.Get "lib/jquery/jquery.slim.min.js" | resources.Fingerprint "sha512" }}
{{/* Mermaid */}}
@@ -72,4 +72,4 @@
{{ $youtubeLiteCSS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.css" }}
-{{ end }}
\ No newline at end of file
+{{ end }}
From df0a232bfc6d0a6b836680fd58e9f0bffa82b167 Mon Sep 17 00:00:00 2001
From: "W.T. Chang" <1546333+wtchangdm@users.noreply.github.com>
Date: Wed, 24 Jul 2024 23:27:00 +0800
Subject: [PATCH 2/4] add hash to zoom.min.js
---
{static/js => assets/lib/zoom}/zoom.min.js | 0
layouts/partials/head.html | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
rename {static/js => assets/lib/zoom}/zoom.min.js (100%)
diff --git a/static/js/zoom.min.js b/assets/lib/zoom/zoom.min.js
similarity index 100%
rename from static/js/zoom.min.js
rename to assets/lib/zoom/zoom.min.js
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index f59e9dc8..4540753b 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -74,7 +74,8 @@
}}">
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
-
+ {{ $zoomJS := resources.Get "lib/zoom/zoom.min.js" | resources.Fingerprint "sha512" }}
+
{{ end }}
{{/* Icons */}}
{{ if templates.Exists "partials/favicons.html" }}
From 4fec5ab53230d4f0e76fd19d99558707d1ba915b Mon Sep 17 00:00:00 2001
From: "W.T. Chang" <1546333+wtchangdm@users.noreply.github.com>
Date: Wed, 24 Jul 2024 23:27:11 +0800
Subject: [PATCH 3/4] add hash to youtube lite
---
layouts/partials/vendor.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/partials/vendor.html b/layouts/partials/vendor.html
index 589236ea..4720b94c 100644
--- a/layouts/partials/vendor.html
+++ b/layouts/partials/vendor.html
@@ -68,7 +68,7 @@
{{/* youtubeLite */}}
{{ if .Page.HasShortcode "youtubeLite" }}
-{{ $youtubeLiteJS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.js" }}
+{{ $youtubeLiteJS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.js" | resources.Fingerprint "sha512" }}
{{ $youtubeLiteCSS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.css" }}
From 8220a922a886dff787bfa3ee4b202b3d314dd2a9 Mon Sep 17 00:00:00 2001
From: "W.T. Chang" <1546333+wtchangdm@users.noreply.github.com>
Date: Thu, 25 Jul 2024 00:06:02 +0800
Subject: [PATCH 4/4] add hash to typeit
---
layouts/partials/vendor.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/partials/vendor.html b/layouts/partials/vendor.html
index 4720b94c..b273cf34 100644
--- a/layouts/partials/vendor.html
+++ b/layouts/partials/vendor.html
@@ -46,7 +46,7 @@
{{/* TypeIt */}}
{{ if .Page.HasShortcode "typeit" }}
-{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" }}
+{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" | resources.Fingerprint "sha512" }}
{{ end }}