durfdoen-2.0/Rules

94 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2020-02-27 15:55:36 +00: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 = {
2020-09-15 18:51:15 +00:00
identifier: thema,
2020-09-16 15:23:17 +00:00
naam: thema.downcase
}
identifier = "/themas/#{thema}"
@items.create(content, attributes, identifier)
end
end
compile '/{verenigingen,projecten,konventen}/*.md' do
2020-02-27 15:55:36 +00:00
filter :kramdown
layout '/detail.*'
layout '/default.*'
2020-08-28 20:14:28 +00:00
layout '/base.*'
write ext: 'html'
end
compile '/themas/*' do
layout '/thema.*'
layout '/default.*'
2020-09-12 15:19:35 +00:00
layout '/base.*'
write ext: 'html'
end
2020-02-27 15:55:36 +00:00
compile '/homepage.md' do
filter :kramdown
layout '/homepage.*'
2020-09-12 20:02:12 +00:00
layout '/default.*'
2020-08-28 20:14:28 +00:00
layout '/base.*'
2020-02-27 15:55:36 +00:00
write '/index.html'
end
2020-03-19 22:01:10 +00:00
compile '/faq/*' do
filter :kramdown
end
2020-02-27 15:55:36 +00:00
compile '/verenigingen.md' do
filter :kramdown
layout '/verenigingen.*'
layout '/default.*'
2020-08-28 20:14:28 +00:00
layout '/base.*'
write '/verenigingen/index.html'
2020-02-27 15:55:36 +00:00
end
2020-02-27 20:45:34 +00:00
compile '/quiz.md' do
filter :kramdown
layout '/quiz.*'
layout '/default.*'
2020-09-06 18:41:54 +00:00
layout '/base.*'
2020-09-15 19:41:04 +00:00
write '/quiz/index.html'
2020-02-27 20:45:34 +00:00
end
2020-09-09 19:54:22 +00:00
compile '/search.html.erb' do
filter :erb
layout '/default.*'
layout '/base.*'
write ext: 'html'
end
2020-02-27 15:55:36 +00:00
compile '/*.md' do
filter :kramdown
layout '/default.*'
2020-08-28 20:14:28 +00:00
layout '/base.*'
2020-02-27 15:55:36 +00: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 19:43:44 +00:00
compile '/*.erb' do
2020-03-19 20:05:26 +00:00
filter :erb
layout '/default.*'
layout '/base.*'
2020-08-28 20:41:50 +00:00
write item.identifier.without_ext + '/index.html'
2020-03-19 19:43:44 +00:00
end
layout '/**/*', :erb
2020-02-27 15:55:36 +00:00
# Catch-all
compile '/**/*' do
write item.identifier.to_s
end