catch missing blog post

This commit is contained in:
Kyle Drake 2013-07-21 23:02:38 +02:00
parent 748e27120f
commit b4e768d392

4
app.rb
View file

@ -76,7 +76,9 @@ end
get '/blog/:article' do |article|
# expires 500, :public, :must_revalidate
return File.read File.join(DIR_ROOT, 'public', 'sites', 'blog', "#{article}.html")
path = File.join DIR_ROOT, 'public', 'sites', 'blog', "#{article}.html"
pass if !File.exist?(path)
File.read path
end
get '/new' do