Last active
July 25, 2016 01:49
-
-
Save budparr/70ee9bd784b3598a41dfa17485f96f5c to your computer and use it in GitHub Desktop.
Jekyll Events, with limiting posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign events = "" | split: "|" %} | |
{% for item in site.posts %} | |
{% assign current_date = site.time | date: "%Y%m%d" %} | |
{% assign postdate = item.date | date: "%Y%m%d" %} | |
{% if postdate > current_date %} | |
{% assign events = events | push: item %} | |
{% endif %} | |
{% endfor %} | |
{% assign upcoming_events = events | sort: 'date', 'last' | reverse %} | |
{% for object in upcoming_events limit: 10 %} | |
//stuff here | |
{% endfor %} | |
{% comment %} | |
this technique may be superceded by the where_exp filter in 3.2 | |
{% endcomment %} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment