我使用的是液体,杰基尔张贴在我的乐队的网站(http://longislandsound.com.au)液体
我要的是自动隐藏旧日期,日期比较日期,所以我不不得不再次进入并删除它们。我认为最好的办法是将发布日期与当前日期进行比较,如果日期未来,则只显示帖子,但我无法弄清楚如何做到这一点。
下面是当前的代码:
<ul id="dates">
{% for post in site.posts reversed %}
<a href="{{post.link}}">
<li>
<div class="date">
<span class="day">{{post.date | date: "%d"}}</span><br />
<span class="month">{{post.date | date: "%b"}}</span>
<span class="week">{{post.date | date: "%a"}}</span>
</div>
<div class="details">
<span class="venue">{{post.venue}}</span><br />
<span class="town">{{post.town}}</span>
</div>
</li>
</a>
{% endfor %}
</ul>
if语句我已经尝试了一些,但我想不出如何将发布日期比较当前日期。
任何人都可以帮忙吗?
有没有什么办法来过滤帖子,只包含循环以外的未来事件?随着事件数量的增加,我现在的成像测试会比'event.date'要昂贵。他们提到使用'with_scope' [这里](https://groups.google.com/forum/#!topic/locomotivecms/4-3gZbv03V0),但Jekyll不认为它是一个标签。 – Roy
这非常有帮助,谢谢! – aaandre