From 878e46a711987259c898466721241ca93b713bfa Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Tue, 3 Oct 2017 14:07:39 +0200 Subject: [PATCH] Add facebook fetch command --- .gitignore | 2 ++ content/events/16-17/25codenight.md | 2 +- lib/helpers/ical.rb | 2 +- lib/helpers/preprocess.rb | 7 ++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ff54edc..6dde760 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ node_modules/ *.iml .author-information + +.fb_token diff --git a/content/events/16-17/25codenight.md b/content/events/16-17/25codenight.md index 2b0f6b8..84565e2 100644 --- a/content/events/16-17/25codenight.md +++ b/content/events/16-17/25codenight.md @@ -3,7 +3,7 @@ title: 25h codenight image: https://zeus.ugent.be/zeuswpi/FS1Hc2l8.png description: 1 uur voor elk levensjaar van Zeus! created_at: 11-10-2016 -time: 1-11-2016 +time: 01-11-2016 00:00 location: Therminal banner: https://zeus.ugent.be/zeuswpi/vRX2hOYZ.png locationlink: Hoveniersberg, Gent diff --git a/lib/helpers/ical.rb b/lib/helpers/ical.rb index 3c3b880..1369e0f 100644 --- a/lib/helpers/ical.rb +++ b/lib/helpers/ical.rb @@ -16,7 +16,7 @@ module IcalHelper e.dtstart = Icalendar::Values::DateTime.new item[:time], 'tzid' => tzid e.dtend = Icalendar::Values::DateTime.new item[:end], 'tzid' => tzid if item[:end] e.summary = item[:title] - e.description = item[:description] + "\n\n" + item.reps[:text].compiled_content + e.description = "#{item[:description]}\n\n#{item.reps[:text].compiled_content}" e.location = item[:location] e.url = @config[:base_url] + item.path diff --git a/lib/helpers/preprocess.rb b/lib/helpers/preprocess.rb index 32465ca..b60eabe 100644 --- a/lib/helpers/preprocess.rb +++ b/lib/helpers/preprocess.rb @@ -38,8 +38,13 @@ module PreprocessHelper end def convert_event_time_to_timestamps - all_events.each do |event| + @items.find_all('/events/*/*.md').each do |event| + # HACK: Strings in a format like "2017-10-05T20:45:00+0200" automatically get converted to Time + + event[:time] = event[:time].to_s event[:time] = DateTime.parse(event[:time]) + + event[:end] = event[:end].to_s if event[:end] event[:end] = DateTime.parse(event[:end]) if event[:end] end end