From 65e160dec09cbe5068b8297219839acf2697abaa Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Tue, 25 Nov 2014 19:13:01 -0600 Subject: [PATCH] WIP Add JSON endpoint for events No dice so far, because Liquid is stupid. See #5 --- _includes/set_event_date | 1 + events/feed.json | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 events/feed.json diff --git a/_includes/set_event_date b/_includes/set_event_date index ec276227..3e5861f9 100644 --- a/_includes/set_event_date +++ b/_includes/set_event_date @@ -3,3 +3,4 @@ {% else %} {% assign event_date = include.event.date %} {% endif %} + diff --git a/events/feed.json b/events/feed.json new file mode 100644 index 00000000..689d48d5 --- /dev/null +++ b/events/feed.json @@ -0,0 +1,14 @@ +--- +--- +{ + "events": [ + {% for event in site.categories.events %} + {% include set_event_date event=event %} + { + "title": "{{event.title}}", + "date": "{{event.date | date: "%A, %B %d - %I:%M %p"}}", + "excerpt": "{{ event.excerpt | strip_html | replace:'\r\n',' ' }}" + }{% if forloop.rindex0 > 0 %},{% endif %} + {% endfor %} + ] +}