diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb index fc18634c..3033b99e 100644 --- a/lib/jekyll/commands/serve.rb +++ b/lib/jekyll/commands/serve.rb @@ -75,16 +75,20 @@ module Jekyll def webrick_options(config) opts = { - :DocumentRoot => config['destination'], - :Port => config['port'], :BindAddress => config['host'], - :MimeTypes => mime_types, + :DirectoryIndex => %w(index.html index.htm index.cgi index.rhtml index.xml), + :DocumentRoot => config['destination'], :DoNotReverseLookup => true, - :StartCallback => start_callback(config['detach']), - :DirectoryIndex => %w(index.html index.htm index.cgi index.rhtml index.xml) + :MimeTypes => mime_types, + :Port => config['port'], + :StartCallback => start_callback(config['detach']) } - if !config['verbose'] + if config['verbose'] + opts.merge!({ + :Logger => WEBrick::Log.new($stdout, WEBrick::Log::DEBUG) + }) + else opts.merge!({ :AccessLog => [], :Logger => WEBrick::Log.new([], WEBrick::Log::WARN) @@ -118,9 +122,10 @@ module Jekyll # recreate NondisclosureName under utf-8 circumstance def file_handler_options - fh_option = WEBrick::Config::FileHandler - fh_option[:NondisclosureName] = ['.ht*','~*'] - fh_option + WEBrick::Config::FileHandler.merge({ + :FancyIndexing => true, + :NondisclosureName => ['.ht*','~*'] + }) end end