70 lines
1.2 KiB
Ruby
70 lines
1.2 KiB
Ruby
#!/usr/bin/env ruby
|
|
|
|
# engendrement des fichiers html
|
|
|
|
# page d'Accueil
|
|
#route '/' do
|
|
# '/index.html'
|
|
#end
|
|
|
|
# CSS
|
|
compile '/css/*' do
|
|
filter :sass
|
|
end
|
|
route '/css/*' do
|
|
'/Scratch/assets' + item.identifier.chop + '.css'
|
|
end
|
|
|
|
compile '/css/raw/*' do
|
|
end
|
|
route '/css/raw/*' do
|
|
'/Scratch' + item.identifier.sub(/raw\//,'').chop + '.css'
|
|
end
|
|
|
|
# JS
|
|
compile '/js/*' do
|
|
end
|
|
route '/js/*' do
|
|
'/Scratch/assets' + item.identifier.chop + '.js'
|
|
end
|
|
|
|
|
|
# HTML
|
|
# compile '/*' do
|
|
# filter :erb
|
|
# filter :bluecloth
|
|
# layout 'default'
|
|
# end
|
|
|
|
compile '/html/*' do
|
|
# item[:extension] returns 'html.erb' for multi-dotted filename
|
|
ext = item[:extension].nil? ? nil : item[:extension].split('.').last
|
|
|
|
if ext == 'erb'
|
|
filter :erb
|
|
elsif ext == 'haml' || ext.nil?
|
|
filter :haml
|
|
elsif ext == 'md' || ext == 'markdown'
|
|
filter :erb
|
|
filter :kramdown
|
|
else
|
|
raise "Filter is not configured for #{item.identifier} in Rules file."
|
|
end
|
|
|
|
filter :description
|
|
filter :frenchspace
|
|
filter :ytypo
|
|
filter :yabbreviations
|
|
filter :multicorps
|
|
filter :firsthi
|
|
filter :ultraviolet
|
|
|
|
layout 'default' unless item[:layout] == "none"
|
|
end
|
|
|
|
route '/html/*' do
|
|
'/Scratch' + item.identifier.sub('/html','') + 'index.html'
|
|
end
|
|
|
|
layout '*', :erb
|
|
|