mirror of
https://github.com/wezm/wezm.net.git
synced 2024-12-18 18:29:54 +00:00
Apply RubyPants to entire generated page
This commit is contained in:
parent
aabdf612bc
commit
91a1ac083c
2 changed files with 7 additions and 16 deletions
10
Rules
10
Rules
|
@ -4,6 +4,7 @@ require 'pathname'
|
|||
|
||||
compile '/' do
|
||||
layout 'home'
|
||||
filter :rubypants
|
||||
end
|
||||
|
||||
compile '*/json/' do
|
||||
|
@ -13,12 +14,14 @@ end
|
|||
compile %r{/(?:technical|personal|)articles/(page/|)} do
|
||||
filter :erb
|
||||
layout 'articles'
|
||||
filter :rubypants
|
||||
end
|
||||
|
||||
compile %r(/\d{4}/*) do
|
||||
filter :smart_rdiscount
|
||||
compile %r(/\d{4}/.*) do
|
||||
filter :rdiscount
|
||||
layout 'article'
|
||||
layout 'default'
|
||||
filter :rubypants
|
||||
end
|
||||
|
||||
compile %r{.*/feed/} do
|
||||
|
@ -30,8 +33,9 @@ compile %r{(?:/robots/|/sitemap)} do
|
|||
end
|
||||
|
||||
compile '*' do
|
||||
filter :smart_rdiscount
|
||||
filter :rdiscount
|
||||
layout 'default'
|
||||
filter :rubypants
|
||||
end
|
||||
|
||||
route '*/json/' do
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue