mirror of
https://github.com/wezm/wezm.net.git
synced 2024-12-22 20:19:54 +00:00
75 lines
1.1 KiB
Ruby
75 lines
1.1 KiB
Ruby
#!/usr/bin/env ruby
|
|
|
|
compile '/' do
|
|
layout 'home'
|
|
filter :rubypants
|
|
end
|
|
|
|
compile '/weather/' do
|
|
layout 'weather'
|
|
filter :erb
|
|
end
|
|
|
|
compile %r{/(?:technical|personal|)articles/(page/|)} do
|
|
filter :erb
|
|
layout 'articles'
|
|
filter :rubypants
|
|
end
|
|
|
|
compile %r(/\d{4}/.*) do
|
|
filter :rdiscount
|
|
layout 'article'
|
|
layout 'default'
|
|
filter :rubypants
|
|
end
|
|
|
|
compile %r(/about/.*) do
|
|
filter :rdiscount
|
|
layout 'topphoto'
|
|
filter :rubypants
|
|
end
|
|
|
|
compile %r{.*/feed/} do
|
|
filter :erb
|
|
end
|
|
|
|
compile %r{^/(?:robots|sitemap)/$} do
|
|
filter :erb
|
|
end
|
|
|
|
compile %r{^/(?:screen|mobile)/$} do
|
|
filter :sass
|
|
end
|
|
|
|
compile '*' do
|
|
filter :rdiscount
|
|
layout 'default'
|
|
filter :rubypants
|
|
end
|
|
|
|
route %r{.*/feed/$} do
|
|
item.identifier + 'index.xml'
|
|
end
|
|
|
|
route '/robots/' do
|
|
'/robots.txt'
|
|
end
|
|
|
|
route '/sitemap/' do
|
|
'/sitemap.xml'
|
|
end
|
|
|
|
# route '*/json/' do
|
|
# path = Pathname(item.identifier)
|
|
# (path.dirname + 'articles.json').to_s
|
|
# end
|
|
|
|
route %r{^/(?:screen|mobile)/$} do
|
|
File.join("", "css", File.basename(item.identifier) + ".css")
|
|
end
|
|
|
|
route '*' do
|
|
item.identifier + 'index.html'
|
|
end
|
|
|
|
layout '*', :erb
|