2020-02-27 16:55:36 +01:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
2020-08-29 00:09:04 +02:00
|
|
|
preprocess do
|
|
|
|
# Fetch a list of theme names from all items and construct items from them
|
|
|
|
themas = @items.map { |i| i[:themas] }.flatten.uniq.compact
|
|
|
|
themas.each do |thema|
|
|
|
|
content = ''
|
|
|
|
attributes = {
|
|
|
|
naam: thema,
|
|
|
|
verenigingen: @items.filter{|i| i[:themas] and i[:themas].include?(thema)}.flatten.uniq.compact
|
|
|
|
}
|
|
|
|
identifier = "/themas/#{thema}"
|
|
|
|
|
|
|
|
@items.create(content, attributes, identifier)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
compile '/{verenigingen,projecten}/*.md' do
|
2020-02-27 16:55:36 +01:00
|
|
|
filter :kramdown
|
|
|
|
layout '/vereniging.*'
|
|
|
|
layout '/default.*'
|
2020-08-28 22:14:28 +02:00
|
|
|
layout '/base.*'
|
2020-02-27 16:55:36 +01:00
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
2020-08-28 22:41:50 +02:00
|
|
|
compile '/evenementen/*.md' do
|
2020-02-27 23:03:14 +01:00
|
|
|
filter :kramdown
|
2020-08-28 22:41:50 +02:00
|
|
|
layout '/evenement.*'
|
2020-02-27 23:03:14 +01:00
|
|
|
layout '/default.*'
|
2020-08-28 22:14:28 +02:00
|
|
|
layout '/base.*'
|
2020-02-27 23:03:14 +01:00
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
|
|
|
compile '/konventen/*.md' do
|
|
|
|
filter :kramdown
|
|
|
|
layout '/konvent.*'
|
|
|
|
layout '/default.*'
|
2020-08-28 22:14:28 +02:00
|
|
|
layout '/base.*'
|
2020-02-27 23:03:14 +01:00
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
2020-08-29 00:09:04 +02:00
|
|
|
compile '/themas/*' do
|
|
|
|
layout '/thema.*'
|
|
|
|
layout '/default.*'
|
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
2020-02-27 16:55:36 +01:00
|
|
|
compile '/homepage.md' do
|
|
|
|
filter :kramdown
|
|
|
|
layout '/homepage.*'
|
2020-08-28 22:14:28 +02:00
|
|
|
layout '/base.*'
|
2020-02-27 16:55:36 +01:00
|
|
|
write '/index.html'
|
|
|
|
end
|
|
|
|
|
2020-03-19 23:01:10 +01:00
|
|
|
compile '/faq/*' do
|
|
|
|
filter :kramdown
|
|
|
|
end
|
|
|
|
|
2020-02-27 16:55:36 +01:00
|
|
|
compile '/verenigingen.md' do
|
|
|
|
filter :kramdown
|
|
|
|
layout '/verenigingen.*'
|
|
|
|
layout '/default.*'
|
2020-08-28 22:14:28 +02:00
|
|
|
layout '/base.*'
|
2020-08-29 15:48:36 +02:00
|
|
|
write '/verenigingen/index.html'
|
2020-02-27 16:55:36 +01:00
|
|
|
end
|
|
|
|
|
2020-02-27 21:45:34 +01:00
|
|
|
compile '/quiz.md' do
|
|
|
|
filter :kramdown
|
|
|
|
layout '/quiz.*'
|
|
|
|
layout '/default.*'
|
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
2020-02-27 16:55:36 +01:00
|
|
|
compile '/*.md' do
|
|
|
|
filter :kramdown
|
|
|
|
layout '/default.*'
|
2020-08-28 22:14:28 +02:00
|
|
|
layout '/base.*'
|
2020-02-27 16:55:36 +01:00
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
|
|
|
compile '/stylesheets/*.{sass,scss}' do
|
|
|
|
syntax = @item.identifier.ext.to_sym
|
|
|
|
filter :sass, syntax: syntax, style: :compact
|
|
|
|
write ext: 'css'
|
|
|
|
end
|
|
|
|
|
2020-03-19 20:43:44 +01:00
|
|
|
compile '/*.erb' do
|
2020-03-19 21:05:26 +01:00
|
|
|
filter :erb
|
2020-08-29 15:54:16 +02:00
|
|
|
layout '/default.*'
|
|
|
|
layout '/base.*'
|
2020-08-28 22:41:50 +02:00
|
|
|
write item.identifier.without_ext + '/index.html'
|
2020-03-19 20:43:44 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
layout '/**/*', :erb
|
|
|
|
|
2020-02-27 16:55:36 +01:00
|
|
|
# Catch-all
|
|
|
|
compile '/**/*' do
|
|
|
|
write item.identifier.to_s
|
|
|
|
end
|
|
|
|
|