mirror of https://github.com/lxndrblz/anatole.git

Xen-Echo
10.22.2021 a78946cbf7d3b2bcf348b4be63b46a54b787c6b2
Added a configuration option to disable medium zoom

* Added a configuration option for the medium zoom functionality.
2 files modified
12 ■■■■■ changed files
README.md 9 ●●●●● patch | view | raw | blame | history
layouts/partials/medium-zoom.html 3 ●●●●● patch | view | raw | blame | history
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:
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 -}}