Default `baseurl` to `nil` instead of empty string (#6137)
Merge pull request 6137
This commit is contained in:
parent
3439a0d947
commit
1ae0e83b2d
|
@ -104,7 +104,7 @@ module Jekyll
|
||||||
private
|
private
|
||||||
def start_up_webrick(opts, destination)
|
def start_up_webrick(opts, destination)
|
||||||
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
||||||
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
server.mount(opts["baseurl"].to_s, Servlet, destination, file_handler_opts)
|
||||||
Jekyll.logger.info "Server address:", server_address(server, opts)
|
Jekyll.logger.info "Server address:", server_address(server, opts)
|
||||||
launch_browser server, opts if opts["open_url"]
|
launch_browser server, opts if opts["open_url"]
|
||||||
boot_or_detach server, opts
|
boot_or_detach server, opts
|
||||||
|
|
|
@ -47,7 +47,7 @@ module Jekyll
|
||||||
"detach" => false, # default to not detaching the server
|
"detach" => false, # default to not detaching the server
|
||||||
"port" => "4000",
|
"port" => "4000",
|
||||||
"host" => "127.0.0.1",
|
"host" => "127.0.0.1",
|
||||||
"baseurl" => "",
|
"baseurl" => nil, # this mounts at /, i.e. no subdirectory
|
||||||
"show_dir_listing" => false,
|
"show_dir_listing" => false,
|
||||||
|
|
||||||
# Output Configuration
|
# Output Configuration
|
||||||
|
|
|
@ -45,7 +45,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def sanitized_baseurl
|
def sanitized_baseurl
|
||||||
site.config["baseurl"].chomp("/")
|
site.config["baseurl"].to_s.chomp("/")
|
||||||
end
|
end
|
||||||
|
|
||||||
def ensure_leading_slash(input)
|
def ensure_leading_slash(input)
|
||||||
|
|
Loading…
Reference in New Issue