1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #!/usr/bin/env ruby
- compile '/**/*.html' do
- layout '/default.*'
- filter :erb
- end
- # This is an example rule that matches Markdown (.md) files, and filters them
- # using the :kramdown filter. It is commented out by default, because kramdown
- # is not bundled with Nanoc or Ruby.
- #
- compile '/*.md' do
- filter :kramdown
- layout '/page.*'
- filter :rm_last_nl
- end
- route '/*.{html,md}' do
- if item.identifier =~ '/index.*'
- '/index.html'
- else
- item.identifier.without_ext + '/index.html'
- end
- end
- ignore '/**/#*#'
- ignore '/**/*~'
- route '/posts/*' do
- y,m,d,slug = /([0-9]+)\-([0-9]+)\-([0-9]+)\-([^\.]+)*/.match(item.identifier).captures
- "/#{y}/#{m}/#{d}/#{slug}/index.html"
- end
- compile '/posts/*' do
- filter :kramdown
- layout '/post.html'
- filter :rm_last_nl
- end
- compile '/**/*' do
- write item.identifier.to_s
- end
- layout '/**/*', :erb
|