add image zoom js

This commit is contained in:
Reorx 2022-04-21 23:39:03 +08:00
parent 8c47961c41
commit 48cba7f5ae
2 changed files with 12 additions and 1 deletions

2
assets/js/medium-zoom.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -228,6 +228,15 @@
</script> </script>
{{- end -}} {{- end -}}
{{- if (.Param "EnableImageZoom") }}
{{- $imagezoom := resources.Get "js/medium-zoom.min.js" }}
<script src="{{ $imagezoom.RelPermalink }}" data-no-instant
{{- if site.Params.assets.disableFingerprinting }}integrity="{{ $imagezoom.Data.Integrity }}"{{- end }}
></script>
<script>
mediumZoom('.post-content img');
</script>
{{- end }}
{{ if (.Param "comments") }} {{ if (.Param "comments") }}
{{ partial "comments_js.html" . }} {{ partial "comments_js.html" . }}
@ -250,7 +259,7 @@
{{- /* InstantClick.js */}} {{- /* InstantClick.js */}}
{{- if (.Param "EnableInstantClick") }} {{- if (.Param "EnableInstantClick") }}
{{- $instantclick := slice (resources.Get "js/instantclick.js") | resources.Concat "assets/js/instantclick.js" | minify }} {{- $instantclick := resources.Get "js/instantclick.js" }}
<script src="{{ $instantclick.RelPermalink }}" data-no-instant <script src="{{ $instantclick.RelPermalink }}" data-no-instant
{{- if site.Params.assets.disableFingerprinting }}integrity="{{ $instantclick.Data.Integrity }}"{{- end }} {{- if site.Params.assets.disableFingerprinting }}integrity="{{ $instantclick.Data.Integrity }}"{{- end }}
></script> ></script>