From 8a9aeaa01f6b7dea2ec6a8be64127e6fbfc756ea Mon Sep 17 00:00:00 2001 From: Robbe Van Herck Date: Thu, 19 Mar 2020 21:05:26 +0100 Subject: [PATCH] STUB --- Rules | 1 + content/{stuver.erb => stuver.html.erb} | 0 content/verenigingen.json.erb | 1 + lib/helpers/verenigingen.rb | 10 +++++++++- 4 files changed, 11 insertions(+), 1 deletion(-) rename content/{stuver.erb => stuver.html.erb} (100%) create mode 100644 content/verenigingen.json.erb diff --git a/Rules b/Rules index 5f2766d..f6d8496 100644 --- a/Rules +++ b/Rules @@ -48,6 +48,7 @@ compile '/stylesheets/*.{sass,scss}' do end compile '/*.erb' do + filter :erb write item.identifier.without_ext end diff --git a/content/stuver.erb b/content/stuver.html.erb similarity index 100% rename from content/stuver.erb rename to content/stuver.html.erb diff --git a/content/verenigingen.json.erb b/content/verenigingen.json.erb new file mode 100644 index 0000000..cd43a83 --- /dev/null +++ b/content/verenigingen.json.erb @@ -0,0 +1 @@ +<%= to_json(verenigingen) %> diff --git a/lib/helpers/verenigingen.rb b/lib/helpers/verenigingen.rb index 7ee51a7..7ee4de9 100644 --- a/lib/helpers/verenigingen.rb +++ b/lib/helpers/verenigingen.rb @@ -11,4 +11,12 @@ module VerenigingenHelper def konvents @items.find_all("**/verenigingen/*").map{|x| x[:konvent]}.uniq.compact end - end \ No newline at end of file + def verenigingen + @items.find_all("**/verenigingen/*").map{|x| { + "titel" => x[:titel], + "naam" => x[:naam], + "konvent" => x[:konvent], + "themas" => x[:themas] + }}.to_a + end + end