mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
fix: gallery lightbox doesn't always load
Lightbox may not load in case of gallery shortcode contained within `text` field of a landing page block (v2 blocks). Fix #2972
This commit is contained in:
1 parent
bd183b0755
commit
59b648791d
1 file changed
+8
@@ -95,6 +95,14 @@
|
||||
{{ $has_gallery = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if (eq .Type "landing") }}
|
||||
{{ range $index, $block := .Params.sections }}
|
||||
{{ if (gt (len (findRE `\{\{< gallery` $block.content.text 1)) 0) }}
|
||||
{{ $.Page.Store.Set "has_gallery" true }}
|
||||
{{ $has_gallery = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $has_gallery | or site.Params.require_fancybox }}
|
||||
{{ 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 }}
|
||||
|
||||
Reference in new issue
Block a user