Skip to content

Commit 0ab72c6

Browse files
Removed unused code and unnecessary conditional from event_layout.html.
Implemented the above include in index.html. This change fixes no events being shown properly in Chapter View.
1 parent c504551 commit 0ab72c6

File tree

2 files changed

+13
-33
lines changed

2 files changed

+13
-33
lines changed

_includes/event_layout.html

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,20 @@
1616

1717
Returns:
1818
{% endcomment %}
19+
1920
{% assign post = include.event %}
2021
<div class="col-lg-12 no-padding-x">
21-
{% if upcoming_event == true %}
22-
<div>
23-
{% unless post.date == current_date %}
24-
<p class="date"><i class="far fa-calendar-alt"></i> {{ post.date | date: "%e %B %Y" }}</p>
25-
{% endunless %}
26-
{% assign current_date = post.date %}
27-
{% include get_project.html event = post %}
28-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
29-
<!--
30-
<img src="{{ site.baseurl }}/{{ project.logo }}" alt="">
31-
<p class="content">{{ post.content }}</p>
32-
-->
33-
<p class="text-capitalize"><i class="fas fa-map-marker-alt"></i> {{ post.category }}</p>
34-
{% unless forloop.last %}<hr class="chapter__divider-left"/>{% endunless %}
35-
</div>
36-
{% else %}
37-
<p>No upcoming events at the moment</p>
38-
{% endif %}
39-
</div>
22+
<div>
23+
{% unless post.date == current_date %}
24+
<p class="date"><i class="far fa-calendar-alt"></i> {{ post.date | date: "%e %B %Y" }}</p>
25+
{% endunless %}
26+
{% assign current_date = post.date %}
27+
{% include get_project.html event = post %}
28+
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
29+
<p class="text-capitalize"><i class="fas fa-map-marker-alt"></i> {{ post.category }}</p>
30+
{% unless forloop.last %}<hr class="chapter__divider-left"/>{% endunless %}
31+
</div>
32+
</div>
4033

4134

4235

index.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,7 @@ <h2>Upcoming events</h2>
5454
{% if upcoming_event == true %}
5555
{% assign current_date = "" %}
5656
{% for post in posts %}
57-
<div>
58-
{% unless post.date == current_date %}
59-
<p class="date"><i class="far fa-calendar-alt"></i> {{ post.date | date: "%e %B %Y" }}</p>
60-
{% endunless %}
61-
{% assign current_date = post.date %}
62-
{% include get_project.html event = post %}
63-
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
64-
<!--
65-
<img src="{{ site.baseurl }}/{{ project.logo }}" alt="">
66-
<p class="content">{{ post.content }}</p>
67-
-->
68-
<p class="text-capitalize"><i class="fas fa-map-marker-alt"></i> {{ post.category }}</p>
69-
{% unless forloop.last %}<hr/>{% endunless %}
70-
</div>
57+
{% include event_layout.html event=post %}
7158
{% endfor %}
7259
{% else %}
7360
<p>No upcoming events at the moment</p>

0 commit comments

Comments
 (0)