mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 03:00:50 +02:00
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:
parent
3ae036b9c3
commit
dc09534e2b
2 changed files with 4 additions and 2 deletions
|
@ -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 }}
|
||||
|
||||
|
|
|
@ -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 }}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue