Apply RubyPants to entire generated page

This commit is contained in:
Wesley Moore 2010-04-01 07:57:37 +11:00
parent aabdf612bc
commit 91a1ac083c
2 changed files with 7 additions and 16 deletions

10
Rules
View file

@ -4,6 +4,7 @@ require 'pathname'
compile '/' do compile '/' do
layout 'home' layout 'home'
filter :rubypants
end end
compile '*/json/' do compile '*/json/' do
@ -13,12 +14,14 @@ end
compile %r{/(?:technical|personal|)articles/(page/|)} do compile %r{/(?:technical|personal|)articles/(page/|)} do
filter :erb filter :erb
layout 'articles' layout 'articles'
filter :rubypants
end end
compile %r(/\d{4}/*) do compile %r(/\d{4}/.*) do
filter :smart_rdiscount filter :rdiscount
layout 'article' layout 'article'
layout 'default' layout 'default'
filter :rubypants
end end
compile %r{.*/feed/} do compile %r{.*/feed/} do
@ -30,8 +33,9 @@ compile %r{(?:/robots/|/sitemap)} do
end end
compile '*' do compile '*' do
filter :smart_rdiscount filter :rdiscount
layout 'default' layout 'default'
filter :rubypants
end end
route '*/json/' do route '*/json/' do

View file

@ -1,13 +0,0 @@
module WezM::Filters
class SmartRDiscount < Nanoc3::Filter
def run(content, params={})
require 'rdiscount'
markdown = ::RDiscount.new(content)
markdown.smart = true
markdown.to_html
end
end
end
Nanoc3::Filter.register '::WezM::Filters::SmartRDiscount', :smart_rdiscount