From 58b270a3e1039be53cd3c33e516e1bfd3457c13f Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 27 Nov 2022 21:56:19 +0000 Subject: [PATCH] feat: gallery detection in v2 block system --- modules/wowchemy/layouts/partials/site_head.html | 2 +- modules/wowchemy/layouts/shortcodes/gallery.html | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/wowchemy/layouts/partials/site_head.html b/modules/wowchemy/layouts/partials/site_head.html index 1c4521b0..6ddeb2e7 100644 --- a/modules/wowchemy/layouts/partials/site_head.html +++ b/modules/wowchemy/layouts/partials/site_head.html @@ -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 }} diff --git a/modules/wowchemy/layouts/shortcodes/gallery.html b/modules/wowchemy/layouts/shortcodes/gallery.html index b1a55f13..83139031 100644 --- a/modules/wowchemy/layouts/shortcodes/gallery.html +++ b/modules/wowchemy/layouts/shortcodes/gallery.html @@ -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 "*" }}