Merge pull request #11 from ZeusWPI/verenigingen-json

Add verenigingen.json generation
This commit is contained in:
rovherck 2020-05-06 17:33:31 +02:00 committed by GitHub Enterprise
commit 93c6f8e33e
4 changed files with 17 additions and 2 deletions

8
Rules
View file

@ -57,9 +57,15 @@ compile '/stylesheets/*.{sass,scss}' do
write ext: 'css'
end
compile '/*.erb' do
filter :erb
write item.identifier.without_ext
end
layout '/**/*', :erb
# Catch-all
compile '/**/*' do
write item.identifier.to_s
end
layout '/**/*', :erb

View file

@ -0,0 +1 @@
<%= verenigingen.to_json %>

View file

@ -11,4 +11,12 @@ module VerenigingenHelper
def konvents
@items.find_all("**/verenigingen/*").map{|x| x[:konvent]}.uniq.compact
end
end
def verenigingen
@items.find_all("**/verenigingen/*").map{|x| {
"titel" => x[:titel],
"naam" => x[:naam],
"konvent" => x[:konvent],
"themas" => x[:themas]
}}.to_a
end
end