Only show events sidebar box if events available
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -1,9 +1,3 @@
|
||||
{% if site.events.size > 0 %}
|
||||
<div class="card sidebar mb-3">
|
||||
<header class="card-header">
|
||||
Events
|
||||
</header>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% capture now-unix %}{{ 'now' | date: '%s' | divided_by: 86400 }}{% endcapture %}
|
||||
{% assign events = site.events | sort:'start_date' %}
|
||||
{% assign offset_var = 0 %}
|
||||
@ -13,6 +7,12 @@
|
||||
{% assign offset_var = offset_var|plus:1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if events.size > 0 && events.size > offset_var %}
|
||||
<div class="card sidebar mb-3">
|
||||
<header class="card-header">
|
||||
Events
|
||||
</header>
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for event in events offset:offset_var limit:3 %}
|
||||
{% capture event-time %}{{ event.start_date | date: '%s' | divided_by: 86400 }}{% endcapture %}
|
||||
{% if now-unix <= event-time %}
|
||||
|
||||
Reference in New Issue
Block a user