From 41bd304eadf9a1f96963b08e0094c3394ca3d4e9 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Thu, 30 Mar 2023 01:28:35 +0200 Subject: [PATCH] add start and end date for bod members Signed-off-by: Toshaan Bharvani --- .../layouts/boardofdirectors/list.html | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/themes/openpowerfoundation/layouts/boardofdirectors/list.html b/themes/openpowerfoundation/layouts/boardofdirectors/list.html index 08238d6..aed9a15 100644 --- a/themes/openpowerfoundation/layouts/boardofdirectors/list.html +++ b/themes/openpowerfoundation/layouts/boardofdirectors/list.html @@ -5,33 +5,37 @@

{{ .Title }}

{{ range .Data.Pages.ByWeight }} - {{ $personfilename := .File.BaseFileName }} - {{ $personfile := printf "%s/%s" "persons" $personfilename }} -
-
- {{ with $.Site.GetPage $personfile }} - {{ if .Param "image" }} - {{ $imagename := .Param "image" }} - {{ $imagelocation := (printf "%s/%s" "images/persons/" $imagename) }} - {{ $imageresource := resources.Get $imagelocation }} - {{ $image := $imageresource.Fit "390x390 webp" }} - {{ .Title }} - {{ else }} - {{ .Title }} - {{ end }} - {{ end }} -
-
-

{{ .Title }}, {{ .Param "position" }}

+ {{ $start := time (.Param "start") }} + {{ $end := time (.Param "end") }} + {{ if and (le now $end) (ge now $start) }} + {{ $personfilename := .File.BaseFileName }} + {{ $personfile := printf "%s/%s" "persons" $personfilename }} +
+
{{ with $.Site.GetPage $personfile }} - {{ $memberfile := printf "%s/%s" "members" (.Param "member") }} - {{ with $.Site.GetPage $memberfile }} -

{{ .Title }}

+ {{ if .Param "image" }} + {{ $imagename := .Param "image" }} + {{ $imagelocation := (printf "%s/%s" "images/persons/" $imagename) }} + {{ $imageresource := resources.Get $imagelocation }} + {{ $image := $imageresource.Fit "390x390 webp" }} + {{ .Title }} + {{ else }} + {{ .Title }} {{ end }} -

{{ .Content }}

{{ end }} -
-
+
+
+

{{ .Title }}, {{ .Param "position" }}

+ {{ with $.Site.GetPage $personfile }} + {{ $memberfile := printf "%s/%s" "members" (.Param "member") }} + {{ with $.Site.GetPage $memberfile }} +

{{ .Title }}

+ {{ end }} +

{{ .Content }}

+ {{ end }} +
+
+ {{ end }} {{ end }}