From 9d2999befc5085fac5aa7a119c9545fa9e06c5d8 Mon Sep 17 00:00:00 2001
From: Josh
Date: Tue, 10 Jun 2025 15:57:55 -0700
Subject: [PATCH 1/2] make merch sale display conditional based on a param in
site config
---
site/config/_default/hugo.toml | 1 +
site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html | 2 +-
.../s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/site/config/_default/hugo.toml b/site/config/_default/hugo.toml
index 2f6a3123..5966ebc2 100644
--- a/site/config/_default/hugo.toml
+++ b/site/config/_default/hugo.toml
@@ -109,6 +109,7 @@ disableKinds = ["taxonomy", "term"]
[params.festival]
name = "Bike Summer"
active = true # set to true when festival is happening soon or now
+ merchSaleActive = false # set to true when merch sales are open
donationsURL = "https://www.paypal.com/donate/?cmd=_s-xclick&hosted_button_id=NQAUFEUSM49ZJ"
# Main page image carousel
diff --git a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html
index 2cd842fb..084ea031 100644
--- a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html
+++ b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html
@@ -33,7 +33,7 @@
- {{ partial "cal/pp-merch.html" . }}
+ {{ if eq (.Param "festival.merchSaleActive") true }}{{ partial "cal/pp-merch.html" . }}{{ end }}
{{ end }}
diff --git a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html
index 906ca8d9..46b4490f 100644
--- a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html
+++ b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html
@@ -7,5 +7,5 @@
- {{ partial "cal/pp-merch.html" . }}
+ {{ if eq (.Param "festival.merchSaleActive") true }}{{ partial "cal/pp-merch.html" . }}{{ end }}
From 13fde417c4ace3a2a9d056996feb561f6c9c5bff Mon Sep 17 00:00:00 2001
From: Josh
Date: Wed, 11 Jun 2025 16:04:37 -0700
Subject: [PATCH 2/2] use simpler syntax when checking boolean site params
---
site/themes/s2b_hugo_theme/layouts/calevents/single.html | 2 +-
site/themes/s2b_hugo_theme/layouts/calgrid/single.html | 2 +-
.../themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html | 4 ++--
.../s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/site/themes/s2b_hugo_theme/layouts/calevents/single.html b/site/themes/s2b_hugo_theme/layouts/calevents/single.html
index a18c57ca..d9a86775 100644
--- a/site/themes/s2b_hugo_theme/layouts/calevents/single.html
+++ b/site/themes/s2b_hugo_theme/layouts/calevents/single.html
@@ -3,7 +3,7 @@
- {{ if eq (.Param "festival.active") true }}
+ {{ if .Site.Params.festival.active }}
{{ partial "cal/pp-promo-banner.html" . }}
{{ end }}
diff --git a/site/themes/s2b_hugo_theme/layouts/calgrid/single.html b/site/themes/s2b_hugo_theme/layouts/calgrid/single.html
index 41e41c68..370d3a39 100644
--- a/site/themes/s2b_hugo_theme/layouts/calgrid/single.html
+++ b/site/themes/s2b_hugo_theme/layouts/calgrid/single.html
@@ -6,7 +6,7 @@
- {{ if eq (.Param "festival.active") true }}
+ {{ if .Site.Params.festival.active }}
{{ partial "cal/pp-promo-banner.html" . }}
{{ end }}
diff --git a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html
index 084ea031..f8314c47 100644
--- a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html
+++ b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-header.html
@@ -16,7 +16,7 @@
{{ if eq (now.Year) (.Param "year") }}
{{ .Param "festival.name" }} is three whole months of fun on two wheels.
- {{ if eq (.Param "festival.active") true }}Add your events for June, July, and August {{ .Param "year" }} now! Seeking inspiration? {{ end }}
+ {{ if .Site.Params.festival.active }}Add your events for June, July, and August {{ .Param "year" }} now! Seeking inspiration? {{ end }}
View the archives of past festivals. If you need help creating or editing an event, check out the calendar FAQ or contact the calendar crew.
@@ -33,7 +33,7 @@
- {{ if eq (.Param "festival.merchSaleActive") true }}{{ partial "cal/pp-merch.html" . }}{{ end }}
+ {{ if .Site.Params.festival.merchSaleActive }}{{ partial "cal/pp-merch.html" . }}{{ end }}
{{ end }}
diff --git a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html
index 46b4490f..ff973b46 100644
--- a/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html
+++ b/site/themes/s2b_hugo_theme/layouts/partials/cal/pp-promo-banner.html
@@ -7,5 +7,5 @@
- {{ if eq (.Param "festival.merchSaleActive") true }}{{ partial "cal/pp-merch.html" . }}{{ end }}
+ {{ if .Site.Params.festival.merchSaleActive }}{{ partial "cal/pp-merch.html" . }}{{ end }}