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`
This commit is contained in:
George Cushen committed 2021-02-19 10:35:51 +00:00
1 parent 3ae036b9c3
commit dc09534e2b
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -86,7 +86,8 @@
{{ end }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (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 "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" media=\"print\" onload=\"this.media='all'\">" (printf $css.fancybox.url $css.fancybox.version) $css.fancybox.sri | safeHTML }}
{{ end }}
+2 -1
View File
@@ -14,7 +14,8 @@
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (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 "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.fancybox.url $js.fancybox.version) $js.fancybox.sri | safeHTML }}
{{ end }}