From dc09534e2b3744e1d290c5e09ce7979ecfad90f9 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Fri, 19 Feb 2021 10:35:51 +0000 Subject: [PATCH] fix: gallery detection on homepage Workaround HasShortcode detection issue by defaulting to requiring fancybox. Can temporarily be disabled by setting `site.Params.require_fancybox` to `false` --- wowchemy/layouts/partials/site_head.html | 3 ++- wowchemy/layouts/partials/site_js.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wowchemy/layouts/partials/site_head.html b/wowchemy/layouts/partials/site_head.html index cf22c417..7a6e5ee8 100644 --- a/wowchemy/layouts/partials/site_head.html +++ b/wowchemy/layouts/partials/site_head.html @@ -86,7 +86,8 @@ {{ end }} {{ printf "" (printf $css.fontAwesome.url $css.fontAwesome.version) $css.fontAwesome.sri | safeHTML }} - {{ if .HasShortcode "gallery" }} + {{/* Workaround `.HasShortcode "gallery"` detection issue on `home/` WidgetPage v1 */}} + {{ if .HasShortcode "gallery" | or (and .IsHome (site.Params.require_fancybox | default true)) }} {{ printf "" (printf $css.fancybox.url $css.fancybox.version) $css.fancybox.sri | safeHTML }} {{ end }} diff --git a/wowchemy/layouts/partials/site_js.html b/wowchemy/layouts/partials/site_js.html index dc22c739..f67caf19 100644 --- a/wowchemy/layouts/partials/site_js.html +++ b/wowchemy/layouts/partials/site_js.html @@ -14,7 +14,8 @@ {{ printf "" (printf $js.isotope.url $js.isotope.version) $js.isotope.sri | safeHTML }} {{ end }} - {{ if .HasShortcode "gallery" }} + {{/* Workaround `.HasShortcode "gallery"` detection issue on `home/` WidgetPage v1 */}} + {{ if .HasShortcode "gallery" | or (and .IsHome (site.Params.require_fancybox | default true)) }} {{ printf "" (printf $js.fancybox.url $js.fancybox.version) $js.fancybox.sri | safeHTML }} {{ end }}