Skip to content

Commit 212a725

Browse files
committed
Filter upcoming trainings in the same way as events and in the frontpage
1 parent 107a76a commit 212a725

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

_layouts/training.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
layout: inner-page-parent
33
---
44

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

817
{% include paginator.html urlPath="training" %}
9-
</div>
18+
</div>

training/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ permalink: /training/
55

66
# Pagination
77
paginate:
8+
per_page: 9999
89
collection: trainings
910
permalink: /:num/
10-
discardPastItems: true
1111
title_suffix: ""
12-
---
12+
---

0 commit comments

Comments
 (0)