Skip to content

Commit

Permalink
Merge pull request nunocoracao#1638 from wtchangdm/add-hash-to-libs
Browse files Browse the repository at this point in the history
Add hash for jquery, zoom, typeit, and youtube lite URLs
  • Loading branch information
nunocoracao authored Aug 10, 2024
2 parents 5409cef + 8220a92 commit fb0fc90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
}}"></script>
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
<script src="{{ "js/zoom.min.js" | relURL }}"></script>
{{ $zoomJS := resources.Get "lib/zoom/zoom.min.js" | resources.Fingerprint "sha512" }}
<script src="{{ $zoomJS.RelPermalink }}" integrity="{{ $zoomJS.Data.Integrity }}"></script>
{{ end }}
{{/* Icons */}}
{{ if templates.Exists "partials/favicons.html" }}
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/vendor.html
Original file line number Diff line number Diff line change
@@ -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" }}
<script src="{{ $jqueryLib.RelPermalink }}" integrity="{{ $jqueryLib.Data.Integrity }}"></script>

{{/* Mermaid */}}
Expand Down Expand Up @@ -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" }}
<script defer src="{{ $typeitLib.RelPermalink }}" integrity="{{ $typeitLib.Data.Integrity }}"></script>
{{ end }}

Expand All @@ -68,8 +68,8 @@

{{/* 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" }}
<link rel="stylesheet" href="{{ $youtubeLiteCSS.RelPermalink }}" integrity="{{ $youtubeLiteCSS.Data.Integrity }}"/>
<script src="{{ $youtubeLiteJS.RelPermalink }}" integrity="{{ $youtubeLiteJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}

0 comments on commit fb0fc90

Please sign in to comment.