templates/nanoc/Rules in origen-0.1.3 vs templates/nanoc/Rules in origen-0.2.0

- old
+ new

@@ -11,13 +11,13 @@ # * 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 '/stylesheet/' do - # dont filter or layout -end +#compile '/stylesheet/' do +# # dont filter or layout +#end compile '*' do if item.binary? # dont filter binary items @@ -27,36 +27,34 @@ # Create HTML from markdown: filter :kramdown, coderay_line_numbers: nil, entity_output: :as_input filter :codeblocks when "haml" filter :haml - when "html" + # These filters don't play nice with complete HTML files + when "html" && !(item[:layout] == "none" || item[:layout] == "None") filter :colorize_syntax, default_colorizer: :coderay, coderay: {css: :style} filter :codeblocks end - unless ["xml", "js"].include?(item[:extension]) - if item[:layout] == "bootstrap" || item[:layout] == "bootstrap3" || !item[:layout] - filter :bootstrap - layout 'bootstrap' - else - fail "Unknown web page layout: #{item[:layout]}" - end + unless ["xml", "js", "css"].include?(item[:extension]) || item[:layout] == "none" || item[:layout] == "None" + item[:layout] = "bootstrap" if item[:layout] == "bootstrap3" + filter :bootstrap + layout item[:layout] || 'bootstrap' filter :search end if item[:zip] || item[:gzip] filter :gzip end end end -route '/stylesheet/' do - '/style.css' -end +#route '/stylesheet/' do +# '/style.css' +#end route '*' do - if item.binary? || ["xml", "js"].include?(item[:extension]) + if item.binary? || ["xml", "js", "css"].include?(item[:extension]) # Write item with identifier /foo/ to /foo.ext item.identifier.chop + '.' + item[:extension] else # Write item with identifier /foo/ to /foo/index.html if item[:zip] || item[:gzip]