🔒 Use pure version of medium-zoom to avoid inline style

This avoids an extra sha sum for a hashed CSP because it merges the CSS into main.bundle.css and avoids any inline styles being applied by medium-zoom.

This addresses concerns mentioned in the closed PR https://github.com/nunocoracao/blowfish/pull/2196, now the same changes are integrated into package.json.

This fixes https://github.com/nunocoracao/blowfish/issues/2195.
This commit is contained in:
Served Smart
2025-07-09 18:52:38 +02:00
parent 8d940881a4
commit 48a2d64023
5 changed files with 14 additions and 5 deletions

View File

@@ -50,6 +50,10 @@
{{ if $cssCustom }}
{{ $assets.Add "css" (slice $cssCustom) }}
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
{{ $cssZoom := resources.Get "lib/zoom/style.css" }}
{{ $assets.Add "css" (slice $cssZoom) }}
{{ end }}
{{ $images := slice }}
{{ $backgroundAndFeaturedImages := slice }}
@@ -133,7 +137,7 @@
data-copied="{{ i18n "code.copied" }}"></script>
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
{{ $zoomJS := resources.Get "lib/zoom/zoom.min.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
{{ $zoomJS := resources.Get "lib/zoom/zoom.min.umd.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script src="{{ $zoomJS.RelPermalink }}" integrity="{{ $zoomJS.Data.Integrity }}"></script>
{{ end }}