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 = {
|
2020-09-15 20:51:15 +02:00
|
|
|
identifier: thema,
|
|
|
|
naam: thema.capitalize
|
2020-08-29 00:09:04 +02:00
|
|
|
}
|
|
|
|
identifier = "/themas/#{thema}"
|
|
|
|
|
|
|
|
@items.create(content, attributes, identifier)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-09-15 20:25:58 +02:00
|
|
|
compile '/{verenigingen,projecten,konventen}/*.md' do
|
2020-02-27 16:55:36 +01:00
|
|
|
filter :kramdown
|
2020-09-15 20:25:58 +02:00
|
|
|
layout '/detail.*'
|
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
|
|
|
|
|
2020-08-29 00:09:04 +02:00
|
|
|
compile '/themas/*' do
|
|
|
|
layout '/thema.*'
|
|
|
|
layout '/default.*'
|
2020-09-12 17:19:35 +02:00
|
|
|
layout '/base.*'
|
2020-08-29 00:09:04 +02:00
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
2020-02-27 16:55:36 +01:00
|
|
|
compile '/homepage.md' do
|
|
|
|
filter :kramdown
|
|
|
|
layout '/homepage.*'
|
2020-09-12 22:02:12 +02:00
|
|
|
layout '/default.*'
|
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.*'
|
2020-09-06 20:41:54 +02:00
|
|
|
layout '/base.*'
|
2020-02-27 21:45:34 +01:00
|
|
|
write ext: 'html'
|
|
|
|
end
|
|
|
|
|
2020-09-09 21:54:22 +02:00
|
|
|
compile '/search.html.erb' do
|
|
|
|
filter :erb
|
|
|
|
layout '/default.*'
|
|
|
|
layout '/base.*'
|
|
|
|
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
|