feat: gallery detection in v2 block system

This commit is contained in:
George Cushen committed 2022-11-27 21:56:19 +00:00
1 parent b60ae7e07c
commit 58b270a3e1
2 files changed
+4 -1

No files matched your search

@@ -91,7 +91,7 @@
{{ end }}
{{ else }}
{{/* Single page */}}
{{ if .HasShortcode "gallery" }}
{{ if .HasShortcode "gallery" | or ($.Page.Store.Get "has_gallery") }}
{{ $has_gallery = true }}
{{ end }}
{{ end }}
@@ -15,6 +15,9 @@
Resize options passed to Hugo `.Fit` function (https://gohugo.io/content-management/image-processing/).
*/}}
{{/* For gallery nested in landing page sections */}}
{{ $.Page.Store.Set "has_gallery" true }}
{{/* Get album folder or default to `media/albums/gallery/`. */}}
{{ $album := (.Get "album") | default "gallery" }}
{{ $album_path := path.Join "media" "albums" $album "*" }}