Rules 742 Bytes
Newer Older
Erwan Bousse's avatar
Erwan Bousse committed
1 2
#!/usr/bin/env ruby

Erwan BOUSSE's avatar
Erwan BOUSSE committed
3 4
compile '/**/*.html' do
  layout '/default.*'
Erwan Bousse's avatar
Erwan Bousse committed
5

Erwan BOUSSE's avatar
Erwan BOUSSE committed
6 7
  if item.identifier =~ '**/index.*'
    write item.identifier.to_s
Erwan Bousse's avatar
Erwan Bousse committed
8
  else
Erwan BOUSSE's avatar
Erwan BOUSSE committed
9
    write item.identifier.without_ext + '/index.html'
Erwan Bousse's avatar
Erwan Bousse committed
10 11 12
  end
end

Erwan BOUSSE's avatar
Erwan BOUSSE committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
# 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
 filter :colorize_syntax, default_colorizer: :rouge
 layout '/default.*'

 if item.identifier =~ '**/index.*'
   write item.identifier.without_ext + ".html"
 else
   write item.identifier.without_ext + '/index.html'
 end
end

compile '/**/*' do
  write item.identifier.to_s
Erwan Bousse's avatar
Erwan Bousse committed
31 32
end

Erwan BOUSSE's avatar
Erwan BOUSSE committed
33
layout '/**/*', :erb