Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (39 sloc) 1.04 KB
#!/usr/bin/env ruby
# A few helpful tips about the Rules file:
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
# * Item identifiers start and end with a slash (e.g. “/about/” for the file
# “content/about.html”). To select all children, grandchildren, … of an
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
# because “*” matches zero or more characters.
compile '*' do
case item[:extension]
when 'haml'
filter :haml
#layout 'default'
when 'erb'
filter :erb
layout 'default'
when 'txt'
filter :erb
filter :redcloth
layout 'default'
filter :sidebar
else
# no filter, no layout
end
end
route '*' do
if item.identifier == '/'
'/index.html'
elsif %w[ html haml erb txt ].include?(item[:extension])
item.identifier.chop + '.html'
else
item.identifier.chop + '.' + item[:extension]
end
end
#layout '*', :haml, :format => :html5
#layout '*', :erb
layout '*', :haml
Something went wrong with that request. Please try again.