Merge pull request #4533 from hgoodman/feature/show-dir-listing
Merge pull request 4533
This commit is contained in:
commit
4ce50e3936
|
@ -10,6 +10,8 @@ module Jekyll
|
||||||
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
|
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
|
||||||
"port" => ["-P", "--port [PORT]", "Port to listen on"],
|
"port" => ["-P", "--port [PORT]", "Port to listen on"],
|
||||||
"baseurl" => ["-b", "--baseurl [URL]", "Base URL"],
|
"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",
|
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
|
||||||
"Skips the initial site build which occurs before the server is started."]
|
"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_ssl(opts)
|
||||||
enable_logging(opts)
|
enable_logging(opts)
|
||||||
opts
|
opts
|
||||||
|
|
|
@ -44,6 +44,7 @@ module Jekyll
|
||||||
'port' => '4000',
|
'port' => '4000',
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'baseurl' => '',
|
'baseurl' => '',
|
||||||
|
'show_dir_listing' => false,
|
||||||
|
|
||||||
# Output Configuration
|
# Output Configuration
|
||||||
'permalink' => 'date',
|
'permalink' => 'date',
|
||||||
|
|
|
@ -68,6 +68,11 @@ class TestCommandsServe < JekyllUnitTest
|
||||||
]
|
]
|
||||||
end
|
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
|
context "verbose" do
|
||||||
should "debug when verbose" do
|
should "debug when verbose" do
|
||||||
assert_equal custom_opts({ "verbose" => true })[:Logger].level, 5
|
assert_equal custom_opts({ "verbose" => true })[:Logger].level, 5
|
||||||
|
|
Loading…
Reference in New Issue