Merge pull request #2260 from servedsmart/use-pure-version-medium-zoom

🔒 Use pure version of medium-zoom to avoid inline style and simplify CSP usage
This commit is contained in:
Nuno C.
2025-07-10 11:40:05 +01:00
committed by GitHub
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 }}
@@ -143,7 +147,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 }}