Merge pull request #3018 from jekyll/webrick-fancy-indexing

This commit is contained in:
Parker Moore 2014-10-20 21:28:35 -07:00
commit 3285aebd4f
1 changed files with 14 additions and 9 deletions

View File

@ -75,16 +75,20 @@ module Jekyll
def webrick_options(config) def webrick_options(config)
opts = { opts = {
:DocumentRoot => config['destination'],
:Port => config['port'],
:BindAddress => config['host'], :BindAddress => config['host'],
:MimeTypes => mime_types, :DirectoryIndex => %w(index.html index.htm index.cgi index.rhtml index.xml),
:DocumentRoot => config['destination'],
:DoNotReverseLookup => true, :DoNotReverseLookup => true,
:StartCallback => start_callback(config['detach']), :MimeTypes => mime_types,
:DirectoryIndex => %w(index.html index.htm index.cgi index.rhtml index.xml) :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!({ opts.merge!({
:AccessLog => [], :AccessLog => [],
:Logger => WEBrick::Log.new([], WEBrick::Log::WARN) :Logger => WEBrick::Log.new([], WEBrick::Log::WARN)
@ -118,9 +122,10 @@ module Jekyll
# recreate NondisclosureName under utf-8 circumstance # recreate NondisclosureName under utf-8 circumstance
def file_handler_options def file_handler_options
fh_option = WEBrick::Config::FileHandler WEBrick::Config::FileHandler.merge({
fh_option[:NondisclosureName] = ['.ht*','~*'] :FancyIndexing => true,
fh_option :NondisclosureName => ['.ht*','~*']
})
end end
end end