Skip to content

Instantly share code, notes, and snippets.

@rgantt
Created June 7, 2011 17:57
Show Gist options
  • Save rgantt/1012755 to your computer and use it in GitHub Desktop.
Save rgantt/1012755 to your computer and use it in GitHub Desktop.
Compiling and routing examples - nanoc
# run index.html through erb
compile '/' do
filter :erb
layout 'page'
end
# run the articles through textile
compile '/articles/*' do
filter :redcloth
layout 'article'
end
# route all of the pages according to their path
route '*' do
item.identifier + 'index.html'
end
compile '/images/*/' do
# don't filter or layout
end
route '/images/*' do
item.identifier.chop + '.' + item[:extension]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment