Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (42 sloc) 1011 Bytes
#!/usr/bin/env ruby
require 'compass'
Compass.add_project_configuration 'compass.config'
preprocess do
@items.each do |item|
case item.identifier
when /posts\/.+/ then
item[:kind] = "article"
when /analysis\/.+/ then
item[:kind] = "analysis"
item[:long_title] = "Analysis of " + item[:title]
end
end
end
route '/vendor/*' do
# /static/foo.ext → /foo.ext
item.identifier[7..-2] + '.' + item[:extension]
end
compile '/vendor/*' do; end
route '/markup/*' do
# /markup/foo.markdown → /foo/index.html
item.identifier[7..-1] + 'index.html'
end
compile '/markup/*' do
begin
filter :erb
filter :rdiscount
layout @item[:layout] || 'default'
rescue Exception => e
raise "Error processing : #{@item.identifier}\n#{e.message}"
end
end
compile '/atom/' do
filter :haml
end
route '/atom/' do
'/atom.xml'
end
# Ignore everything not already matched
compile '*' do; nil; end
route '*' do; nil; end
layout '*', :haml, :format => :html5