durfdoen-2.0/Rules

108 lines
2 KiB
Text
Raw Normal View History

2020-02-27 16:55:36 +01:00
#!/usr/bin/env ruby
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
filter :kramdown
2020-08-28 22:41:50 +02:00
layout '/evenement.*'
layout '/default.*'
2020-08-28 22:14:28 +02:00
layout '/base.*'
write ext: 'html'
end
compile '/konventen/*.md' do
filter :kramdown
layout '/konvent.*'
layout '/default.*'
2020-08-28 22:14:28 +02:00
layout '/base.*'
write ext: 'html'
end
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.*'
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
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