Skip to content

Commit

Permalink
handle empty upcoming list
Browse files Browse the repository at this point in the history
  • Loading branch information
cty12 committed Nov 27, 2023
1 parent 4853e16 commit a486f7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ <h2>Upcoming Events</h2>

<ul id="upcoming-talk-list">
{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %}
{% assign cnt = 0 %}
{% for post in paginator.posts reversed %}
{% capture posttime %}{{post.date | date: '%s'}}{% endcapture %}
{% if posttime >= nowunix %}
Expand All @@ -224,10 +225,15 @@ <h2>Upcoming Events</h2>
{{ post.title }}</a>
<span class="date">{{ post.date | date: "(%m/%d/%Y)" }}</span>
</li>
{% assign cnt = cnt | plus: 1 %}
{% endif %}
{% endfor %}
</ul>

{% if cnt == 0 %}
<p><em> Sorry no event scheduled yet. Please check again later! </em></p>
{% endif %}

<h2>Past Events</h2>

<iframe width="640" height="320" src="https://www.youtube.com/embed/XNgE8kBfSz8" frameborder="0" allowfullscreen></iframe>
Expand Down

0 comments on commit a486f7f

Please sign in to comment.