@@ -27,21 +27,30 @@ <h3 class="about__article__title"><i class="about__article__title__icon ion ion-
27
27
</ section >
28
28
29
29
< section class ="events ">
30
- < h2 class ="section__title "> Akce </ h2 >
30
+ < h2 class ="section__title "> Nadcházející akce </ h2 >
31
31
< div class ="events__article__wrapper ">
32
- {% assign events = site.events | sort: 'date' | reverse %}
33
- {% for event in events limit:3 %}
34
- < a href ="{{event.url}} ">
35
- < article class ="event__article " >
36
- < h3 class ="event__title "> {{event.title}}</ h3 >
37
- < div class ="event__background event__image " style ="background-image: url({{ event.img | relative_url }}); ">
38
- </ div >
39
- < div class ="event__footer ">
40
- < small class ="event__date "> {{ event.date | date: "%-d. %-m. %Y" }}</ small >
41
- < span class ="event__link " href ="{{event.url}} "> Více</ span >
42
- </ div >
43
- </ article >
44
- </ a >
32
+ {% assign today = 'now' | date: "%s" %} <!-- Get today's date as a timestamp -->
33
+ {% assign yesterday = today | minus: 86400 %}
34
+ {% assign i = 0 %}
35
+ {% for event in site.events %}
36
+ {% assign event_timestamp = event.date | date: "%s" %}
37
+ {% assign event_timestamp_int = event_timestamp | minus: 0 %}
38
+ {% if event_timestamp_int > yesterday %}
39
+ {% assign i = i | plus: 1 %}
40
+ {% if i < 4 %}
41
+ < a href ="{{event.url}} ">
42
+ < article class ="event__article " >
43
+ < h3 class ="event__title "> {{event.title}}</ h3 >
44
+ < div class ="event__background event__image " style ="background-image: url({{ event.img | relative_url }}); ">
45
+ </ div >
46
+ < div class ="event__footer ">
47
+ < small class ="event__date "> {{ event.date | date: "%-d. %-m. %Y" }}</ small >
48
+ < span class ="event__link " href ="{{event.url}} "> Více</ span >
49
+ </ div >
50
+ </ article >
51
+ </ a >
52
+ {% endif %}
53
+ {% endif %}
45
54
{% endfor %}
46
55
</ div >
47
56
< a class ="events__more__link " href ="/events "> Další akce</ a >
0 commit comments