#!/usr/bin/env ruby require 'fileutils' compile '/stylesheets/*/' do filter :sass end route '/stylesheets/*/' do item.identifier.chop + '.css' end compile '*' 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 == 'mkd' filter :erb filter :rdiscount elsif ext == 'html' true else raise "Filter is not configured for #{item.identifier} in Rules file." end # use layouts with .html extension or layout specified in meta item[:layout] = "none" unless item[:layout] || File.extname(route_path(item)) == '.html' layout 'default' unless item[:layout] == "none" end route '*' do route_path(item) end layout '*', :haml