From a31607509ef41a3a5288af5a19cc883b794b4ea0 Mon Sep 17 00:00:00 2001 From: Ruby <3r4o02hucyw7o9fekpx8gla2@pollination.email> Date: Tue, 28 Nov 2023 06:25:25 +0100 Subject: [PATCH] Only request zoom library if it is not disabled. There is already a if condition in `footer.html` that only runs the JS from the zoom library if it is enabled per-site. This commit takes the same if condition and applies it in `head.html` as well to save a unnecessary web request to `zoom.min.js` if that is the case. --- layouts/partials/head.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 67ab1713..f59e9dc8 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -73,7 +73,9 @@ integrity="{{ $bundleJS.Data.Integrity }}" data-copy="{{ i18n " code.copy" }}" data-copied="{{ i18n " code.copied" }}"> {{ end }} + {{ if not .Site.Params.disableImageZoom | default true }} + {{ end }} {{/* Icons */}} {{ if templates.Exists "partials/favicons.html" }} {{ partialCached "favicons.html" .Site }}