From a78946cbf7d3b2bcf348b4be63b46a54b787c6b2 Mon Sep 17 00:00:00 2001
From: Xen-Echo <67518109+Xen-Echo@users.noreply.github.com>
Date: Wed, 10 Mar 2021 21:22:30 +0000
Subject: [PATCH] Added a configuration option to disable medium zoom
---
layouts/partials/medium-zoom.html | 3 +++
README.md | 9 +++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
index fdd3ce7..3503e1b 100644
--- a/README.md
+++ b/README.md
@@ -364,6 +364,15 @@
customJs = ["https://cdn.exmple.org/fancyscript.js", "js/world.js"]
```
+### Medium Like Zoom
+
+Enabled by default, the medium like zoom for images can be disabled by adding the following config under `[params]`.
+
+```toml
+[params]
+enableMediumZoom = false
+```
+
### Content Security Policy
The theme is compliant with most strict CSP policies out of the box. A sample CSP for an Anatole-based site would look something like this:
diff --git a/layouts/partials/medium-zoom.html b/layouts/partials/medium-zoom.html
index 1e1b1ff..26ba0f6 100644
--- a/layouts/partials/medium-zoom.html
+++ b/layouts/partials/medium-zoom.html
@@ -1,6 +1,9 @@
+{{ $enableMediumZoom := default true (.Site.Params.enableMediumZoom) }}
+{{- if eq $enableMediumZoom true -}}
{{ $js := resources.Get "js/medium-zoom.js" }}
{{ $secureJS := $js | resources.Minify | resources.Fingerprint }}
<script type="text/javascript"
src="{{ $secureJS.Permalink }}"
integrity="{{ $secureJS.Data.Integrity }}"
crossorigin="anonymous"></script>
+{{- end -}}
\ No newline at end of file
--
Gitblit v1.10.0