From b86e8347eb21a99dd2a7da39e011049dd93cf30d Mon Sep 17 00:00:00 2001 From: tvluke <tvluke@chaotikum.org> Date: Sat, 7 Oct 2023 15:23:33 +0200 Subject: [PATCH] fix bug for events in the future --- _layouts/frab.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_layouts/frab.xml b/_layouts/frab.xml index 51fea228..25ce4a21 100644 --- a/_layouts/frab.xml +++ b/_layouts/frab.xml @@ -18,8 +18,6 @@ Documentation: https://wiki.chaotikum.org/howto:chaotikumwebsite:media (Please u Finding the first and last talk to establish the variables "earliest" and "latest". Then converting this into a duration in days. {% endcomment -%} - -{% capture earliest %}{{'now' | date: '%s'}}{% endcapture -%} {% capture latest %}0{% endcapture -%} {% assign conference_media = site.media | where_exp: "video", "video.conferences contains conference.acronym" -%} @@ -43,13 +41,19 @@ Finding the first and last talk to establish the variables "earliest" and "lates {% if conference.date and recording_date.event != ''%} {% assign recording_date = conference.date -%} {% else -%} - {% assign recording_date = earliest -%} + {% assign recording_date = now -%} {% endif -%} {% endif -%} {% capture recordingdate %}{{recording_date | date: '%s'}}{% endcapture -%} - {% if recordingdate < earliest -%} + + {% if earliest and earliest != '' -%} + {% if recordingdate < earliest -%} + {% assign earliest = recordingdate -%} + {% endif -%} + {% else -%} {% assign earliest = recordingdate -%} {% endif -%} + {% if recordingdate > latest -%} {% assign latest = recordingdate -%} {% endif -%} -- GitLab