mirror of
https://github.com/wezm/wezm.net.git
synced 2024-11-10 01:42:32 +00:00
59 lines
814 B
Ruby
59 lines
814 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require 'pathname'
|
|
|
|
compile '/' do
|
|
layout 'home'
|
|
end
|
|
|
|
compile '*/json/' do
|
|
filter :erb
|
|
end
|
|
|
|
compile %r{/(?:technical|personal|)articles/(page/|)} do
|
|
filter :erb
|
|
layout 'articles'
|
|
end
|
|
|
|
compile %r(/\d{4}/*) do
|
|
filter :smart_rdiscount
|
|
layout 'article'
|
|
layout 'default'
|
|
end
|
|
|
|
compile %r{.*/feed/} do
|
|
filter :erb
|
|
end
|
|
|
|
compile %r{(?:/robots/|/sitemap)} do
|
|
filter :erb
|
|
end
|
|
|
|
compile '*' do
|
|
filter :smart_rdiscount
|
|
layout 'default'
|
|
end
|
|
|
|
route '*/json/' do
|
|
path = Pathname(item.identifier)
|
|
(path.dirname + 'articles.json').to_s
|
|
end
|
|
|
|
route %r{.*/feed/} do
|
|
path = Pathname(item.identifier)
|
|
path.cleanpath.to_s + '.xml'
|
|
end
|
|
|
|
route '/robots/' do
|
|
'/robots.txt'
|
|
end
|
|
|
|
route '/sitemap/' do
|
|
'/sitemap.xml'
|
|
end
|
|
|
|
route '*' do
|
|
item.identifier + 'index.html'
|
|
end
|
|
|
|
layout '*', :erb
|