From bbedf83df4c7f60202d4c0e8ef43cfd1c83d9c04 Mon Sep 17 00:00:00 2001 From: Andrej Shadura Date: Sun, 6 Nov 2022 10:43:39 +0100 Subject: [PATCH] Add a switch to show sections among products --- exampleSite/config.toml | 2 ++ layouts/products/list.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8f277c0..9ea6bac 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -102,6 +102,8 @@ copyright = "| Copyright © 2019 [Gethugothemes](https://gethugothemes.com) # Snipcart Credentials snipcartApiKey = "M2E5YjA3NjMtYzRiYS00YzVjLWEyYWYtNDY5ZDI0OWZhYjg5" currencySymbol = "$" +# whether to show product sections among products +showProductSections = true # Preloader [params.preloader] diff --git a/layouts/products/list.html b/layouts/products/list.html index 5a8a91a..a726631 100644 --- a/layouts/products/list.html +++ b/layouts/products/list.html @@ -6,7 +6,7 @@
{{ range .Data.Pages }} - {{ if not .IsSection }} + {{ if site.Params.showProductSections | or (not .IsSection) }} {{ $image := "" }} {{ if .Params.Image }} {{ $image = .Params.Image | absURL }}