Skip to content

Commit 107a76a

Browse files
committed
Show current events on the upcoming events page until they are over
Partly addresses #895
1 parent 3067ee8 commit 107a76a

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

_layouts/events.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
layout: inner-page-parent
33
---
44

5-
{% include events-training-list-top.html collection=paginator.events %}
5+
{% capture now %}{{site.time | date: '%s' | plus: 0}}{% endcapture %}
6+
{% assign upcomingEvents = '' | split: ',' %}
7+
{% for event in paginator.events %}
8+
{% capture date %}{{event.end|date: '%s'|plus: 86400}}{% endcapture %}
9+
{% if now <= date %}
10+
{% assign upcomingEvents = upcomingEvents | push: event %}
11+
{% endif %}
12+
{% endfor %}
13+
14+
{% include events-training-list-top.html collection=upcomingEvents %}
615

716
{{content}}
817
</div>

_layouts/pastevents.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
layout: inner-page-parent
33
---
44

5-
{% include events-training-list-top.html collection=paginator.events %}
5+
{% capture now %}{{site.time | date: '%s' | plus: 0}}{% endcapture %}
6+
{% assign pastEvents = '' | split: ',' %}
7+
{% for event in paginator.events %}
8+
{% capture date %}{{event.end|date: '%s'|plus: 86400}}{% endcapture %}
9+
{% if now > date %}
10+
{% assign pastEvents = pastEvents | push: event %}
11+
{% endif %}
12+
{% endfor %}
13+
14+
{% include events-training-list-top.html collection=pastEvents %}
615

716
{{content}}
817
</div>

events/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ paginate:
88
per_page: 9999
99
collection: events
1010
permalink: /:num/
11-
discardPastItems: true
1211
title_suffix: ""
1312
---
1413

pastevents/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ paginate:
88
collection: events
99
per_page: 9999
1010
permalink: /:num/
11-
pastItems: true
1211
reversed: true
1312
title_suffix: ""
1413
---

0 commit comments

Comments
 (0)