From 2268e90a69ead11746b997193f8216ed2c61c3d9 Mon Sep 17 00:00:00 2001 From: Victor Lim Date: Thu, 30 Nov 2017 23:45:27 +0800 Subject: [PATCH 1/3] groundwork --- config.rb | 6 +++--- .../cryptobeers-in-leuven-coop-wereldcafe.yml | 12 ++++++++++++ source/index.html.erb | 17 ++++++++--------- 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 data/events/cryptobeers-in-leuven-coop-wereldcafe.yml diff --git a/config.rb b/config.rb index ab6ef38..821a019 100644 --- a/config.rb +++ b/config.rb @@ -35,9 +35,9 @@ # https://middlemanapp.com/basics/helper-methods/ helpers do - def group_by_month(articles) - articles.group_by do |article| - article.data.date.strftime('%B %Y') + def group_by_month(collection) + collection.values.group_by do |item| + item.date.strftime('%B %Y') end end end diff --git a/data/events/cryptobeers-in-leuven-coop-wereldcafe.yml b/data/events/cryptobeers-in-leuven-coop-wereldcafe.yml new file mode 100644 index 0000000..a03032c --- /dev/null +++ b/data/events/cryptobeers-in-leuven-coop-wereldcafe.yml @@ -0,0 +1,12 @@ +--- +title: CryptoBeers in Leuven @ COOP Wereldcafé +image: /images/20171123_212403.jpg +location: COOP Wereldcafé +date: 2017-11-30T19:30:28+01:00 +possible_by: Cryptominded.com +organised_by: Bouke +meetup-link: >- + https://www.meetup.com/The-Cryptominded-Meetup-Belgium-Edition/events/245462570/ +City: 'Leuven, BE' +--- +Let’s drink a beer and chat cryptocurrencies over at COOP Wereldcafé in the city center of Leuven. Bring a friend and have a good evening! diff --git a/source/index.html.erb b/source/index.html.erb index 711fe2e..5bfe3f7 100644 --- a/source/index.html.erb +++ b/source/index.html.erb @@ -11,27 +11,26 @@ title: Cryptobeers -- by Cryptominded
- <% group_by_month(page_articles.reverse).each do |month, articles| %> + <% group_by_month(data.events).each do |month, articles| %>

<%= month %>

-
+
<% articles.each do |article| %> -
- <%= article.date.strftime('%A, %e %B %Y') %><%= article.data.City %> -

<%= article.title %>

+ <%= article.strftime('%A, %e %B %Y') %><%= article.City %> +

<%= article.title %>

<%= article.body %> - Organised by: <%= article.data.organised_by %> - + Organised by: <%= article.organised_by %> +
From 6eb49e3ed1138333406b78c55ff4cdf426bc0d91 Mon Sep 17 00:00:00 2001 From: Victor Lim Date: Thu, 30 Nov 2017 23:55:16 +0800 Subject: [PATCH 2/3] groundwork --- data/events/cryptobeers-in-london.html.yml | 12 +++++++++ source/index.html.erb | 30 +++++++++++----------- 2 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 data/events/cryptobeers-in-london.html.yml diff --git a/data/events/cryptobeers-in-london.html.yml b/data/events/cryptobeers-in-london.html.yml new file mode 100644 index 0000000..68d80c4 --- /dev/null +++ b/data/events/cryptobeers-in-london.html.yml @@ -0,0 +1,12 @@ +--- +title: CryptoBeers in London +image: /images/heidi-sandstrom-187259.jpg +location: To be confirmed +date: 2017-12-14T18:30:28+01:00 +possible_by: Cryptominded +organised_by: Barry Leybovich +meetup-link: >- + https://www.meetup.com/The-Cryptominded-Meetup-London-Edition/events/244863174/ +City: 'London, UK' +--- +Whether you're a seasoned crypto-expert or just a beginner, come and have a chat with like-minded enthusiasts and meet some of the Cryptominded team as well! diff --git a/source/index.html.erb b/source/index.html.erb index 5bfe3f7..c679681 100644 --- a/source/index.html.erb +++ b/source/index.html.erb @@ -11,26 +11,26 @@ title: Cryptobeers -- by Cryptominded
- <% group_by_month(data.events).each do |month, articles| %> + <% group_by_month(data.events).each do |month, events| %>
-

<%= month %>

+

<%= month %>

- <% articles.each do |article| %> + <% events.each do |event| %>
- -
- <%= article.strftime('%A, %e %B %Y') %><%= article.City %> -

<%= article.title %>

- <%= article.body %> - Organised by: <%= article.organised_by %> - + +
+ <%= event.date.strftime('%A, %e %B %Y') %><%= event.City %> +

<%= event.title %>

+
<%= event.postscript %>
+ Organised by: <%= event.organised_by %> +
From 19dedccb3256692b1ab6c79bfaae0614d6f7c9be Mon Sep 17 00:00:00 2001 From: Victor Lim Date: Fri, 1 Dec 2017 00:31:58 +0800 Subject: [PATCH 3/3] sort by date asc --- config.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.rb b/config.rb index 821a019..da49bc6 100644 --- a/config.rb +++ b/config.rb @@ -1,5 +1,6 @@ # Activate and configure extensions # https://middlemanapp.com/advanced/configuration/#configuring-extensions +ENV['TZ'] = 'UTC' activate :autoprefixer do |prefix| prefix.browsers = "last 2 versions" @@ -36,7 +37,7 @@ helpers do def group_by_month(collection) - collection.values.group_by do |item| + collection.values.sort_by { |item| item.date }.group_by do |item| item.date.strftime('%B %Y') end end