Open
Description
Jekyll would usually show old posts(=workshops) and no posts that have a future date. We turned the behavior around with these code lines:
{% assign curDate = site.time | date: '%s' %}
{% for post in site.posts %}
{% assign postStartDate = post.date | date: '%s' %}
{% if postStartDate >= curDate %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
<h2>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</h2>
</li>
{% endif %}
{% endfor %}
This works fine. The only problem is that site.time
only gets updated once we deploy. And we might not deploy everyday. (A deploy happens everytime we push to gh-pages branch.)
💡 The idea is to write a script that updates site.time
everyday.