add cancelled for platinium membership on front page

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
remotes/1691123400723607934/master
Toshaan Bharvani 2 years ago
parent 7facfb03be
commit f8f33d4bc9

@ -4,6 +4,7 @@
{{ $promobackgroundimagelocation := (printf "%s/%s" "images/home/" $promobackgroundimagename) }}
{{ $promobackgroundimageresource := resources.Get $promobackgroundimagelocation }}
{{ $promobackgroundimage := $promobackgroundimageresource.Resize "3840x2160 webp" }}
{{ $now := now.Format "20060102" }}
<section class="home promo__section d-flex flex-column justify-content-center" style="background-image:url({{ $promobackgroundimage.RelPermalink }})" >
<div class="promo__container container text-center">
<h1>{{ .Param "promo.header" }}</h1>
@ -75,6 +76,15 @@
{{ range where .Site.RegularPages "Section" "members" }}
{{ $level := .Param "level" }}
{{ if eq $level "platinum" }}
{{ $memberstatus := true }}
{{ $cancelled := now.Format "20060102" }}
{{ if isset .Params "cancelled" }}
{{ $cancelled = time (.Param "cancelled") | dateFormat "20060102" }}
{{ if lt $cancelled $now }}
{{ $memberstatus = false }}
{{ end }}
{{ end }}
{{ if eq $memberstatus true }}
{{ if .Param "image" }}
{{ $imagename := .Param "image" }}
{{ $imagelocation := (printf "%s/%s" "images/members/" $imagename) }}
@ -86,6 +96,7 @@
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
</div>
</section>

Loading…
Cancel
Save