From b4e768d392e6798122b57760a06f9c111e103ec5 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jul 2013 23:02:38 +0200 Subject: [PATCH] catch missing blog post --- app.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.rb b/app.rb index dab33ad0..56754b3a 100644 --- a/app.rb +++ b/app.rb @@ -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