demo/main.rb in rblosxom-0.1.3 vs demo/main.rb in rblosxom-0.1.4
- old
+ new
@@ -4,10 +4,14 @@
class Main < Base
get '/?' do
set_common_variables
@log.info "Main start"
@log.debug "Main debug"
- content = File.read(File.expand_path("../README.mkd", File.dirname(__FILE__)))
+ index_file = File.expand_path("#{@root}/#{@config["datadir"]}/main.mkd")
+ unless File.exist?(index_file)
+ index_file = File.expand_path("#{@root}/README.mkd")
+ end
+ content = File.read(index_file)
haml :index, :layout => true, :locals => { :content => content }
end
end
end