zeus.ugent.be/Rules

60 lines
942 B
Text
Raw Normal View History

2016-06-09 14:27:23 +02:00
#!/usr/bin/env ruby
2016-07-19 08:39:52 +02:00
# frozen_string_literal: true
2016-06-09 14:27:23 +02:00
2016-07-18 23:34:38 +02:00
# ERB
2016-07-12 23:14:12 +02:00
compile '/**/*.erb' do
2016-06-09 16:08:43 +02:00
filter :erb
2016-07-18 09:24:24 +02:00
layout '/default.erb'
2016-07-19 08:39:52 +02:00
filter :relativize_paths, type: :html
2016-07-18 23:34:38 +02:00
end
2016-07-18 09:24:24 +02:00
2016-07-18 23:34:38 +02:00
# relativize_paths
2016-07-19 08:39:52 +02:00
compile '/**/*.html' do
2016-07-18 09:24:24 +02:00
filter :relativize_paths, type: :html
2016-06-09 14:27:23 +02:00
end
2016-07-18 23:34:38 +02:00
# Coffeescript
2016-06-09 17:57:40 +02:00
compile '/**/*.coffee' do
filter :coffeescript
end
2016-07-18 23:34:38 +02:00
# SCSS
2016-06-29 21:38:57 +02:00
compile '/**/*.scss' do
filter :sass, syntax: :scss
end
2016-07-18 23:34:38 +02:00
# Compile all posts
compile '/posts/**/*.md' do
2016-07-19 08:39:52 +02:00
@item.attributes[:kind] = 'article'
2016-06-09 15:04:10 +02:00
filter :kramdown
2016-07-18 09:24:24 +02:00
2016-07-12 23:58:08 +02:00
layout '/eventpost.erb'
filter :erb
2016-07-18 09:24:24 +02:00
layout '/default.erb'
2016-07-12 23:58:08 +02:00
filter :erb
2016-07-18 09:24:24 +02:00
filter :relativize_paths, type: :html
2016-06-09 15:04:10 +02:00
end
2016-06-09 14:27:23 +02:00
2016-07-18 23:34:38 +02:00
route '/index.*' do
2016-07-18 09:34:01 +02:00
'/index.html'
2016-07-18 09:27:32 +02:00
end
2016-07-18 23:34:38 +02:00
route '/assets/stylesheets/**/*' do
"#{item.identifier.without_ext}.css"
end
route '/assets/scripts/**/*' do
"#{item.identifier.without_ext}.js"
end
passthrough '/**/*.png'
2016-07-18 09:27:32 +02:00
route '/**/*.{erb,html,md}' do
2016-06-09 16:08:43 +02:00
"#{item.identifier.without_ext}/index.html"
2016-06-09 14:27:23 +02:00
end
layout '/**/*', :erb