Merge pull request #4533 from hgoodman/feature/show-dir-listing

Merge pull request 4533
This commit is contained in:
jekyllbot 2016-03-23 17:01:16 -07:00
commit 4ce50e3936
3 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,8 @@ module Jekyll
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
"port" => ["-P", "--port [PORT]", "Port to listen on"],
"baseurl" => ["-b", "--baseurl [URL]", "Base URL"],
"show_dir_listing" => ["--show-dir-listing",
"Show a directory listing instead of loading your index file."],
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
"Skips the initial site build which occurs before the server is started."]
}
@ -91,6 +93,8 @@ module Jekyll
)
}
opts[:DirectoryIndex] = [] if opts[:JekyllOptions]['show_dir_listing']
enable_ssl(opts)
enable_logging(opts)
opts

View File

@ -44,6 +44,7 @@ module Jekyll
'port' => '4000',
'host' => '127.0.0.1',
'baseurl' => '',
'show_dir_listing' => false,
# Output Configuration
'permalink' => 'date',

View File

@ -68,6 +68,11 @@ class TestCommandsServe < JekyllUnitTest
]
end
should "use empty directory index list when show_dir_listing is true" do
opts = { "show_dir_listing" => true }
assert custom_opts(opts)[:DirectoryIndex].empty?
end
context "verbose" do
should "debug when verbose" do
assert_equal custom_opts({ "verbose" => true })[:Logger].level, 5