This Jekyll plugin takes a collection of events and filters out the upcoming events.
Example:
If today was 24 Feb 2016 (a Wednesday), and our events take place weekly on Thursdays, the upcoming events would take place today or later.
upcoming_events.rb
to your _plugins
directory_events
YYYY-MM-DD
prefix Jekyll reserves for posts; use YYYYMMDD
for example.)collections:
events:
output: true
permalink: /event/:path/
Your event files require a special YAML Front Matter block at the beginning. In particular, the start
key is required for figuring out the current event.
Here is an example:
---
layout: event
title: "Next Meetup of our Group"
start: 2016-02-25T19:00:00.00+01:00
end: 2016-02-25T22:00:00.00+01:00
location: "Our usual meetup location"
---
Now, you can access the current event data in your page: site.data.currentEvent
{% assign currentEvent = site.data.upcomingEvents.first %}
<h2><a href="{{ currentEvent.url }}">{{ currentEvent.start }}</a></h2>
<p><strong>{{ currentEvent.location }}</strong></p>
<p>{{ currentEvent.content }}</p>