zeus.ugent.be/Rules
2016-07-19 08:39:52 +02:00

59 lines
942 B
Ruby

#!/usr/bin/env ruby
# frozen_string_literal: true
# ERB
compile '/**/*.erb' do
filter :erb
layout '/default.erb'
filter :relativize_paths, type: :html
end
# relativize_paths
compile '/**/*.html' do
filter :relativize_paths, type: :html
end
# Coffeescript
compile '/**/*.coffee' do
filter :coffeescript
end
# SCSS
compile '/**/*.scss' do
filter :sass, syntax: :scss
end
# Compile all posts
compile '/posts/**/*.md' do
@item.attributes[:kind] = 'article'
filter :kramdown
layout '/eventpost.erb'
filter :erb
layout '/default.erb'
filter :erb
filter :relativize_paths, type: :html
end
route '/index.*' do
'/index.html'
end
route '/assets/stylesheets/**/*' do
"#{item.identifier.without_ext}.css"
end
route '/assets/scripts/**/*' do
"#{item.identifier.without_ext}.js"
end
passthrough '/**/*.png'
route '/**/*.{erb,html,md}' do
"#{item.identifier.without_ext}/index.html"
end
layout '/**/*', :erb