Default `baseurl` to `nil` instead of empty string (#6137)

Merge pull request 6137
This commit is contained in:
Parker Moore 2017-06-15 14:29:07 -04:00 committed by jekyllbot
parent 3439a0d947
commit 1ae0e83b2d
3 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ module Jekyll
private
def start_up_webrick(opts, destination)
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)
launch_browser server, opts if opts["open_url"]
boot_or_detach server, opts

View File

@ -47,7 +47,7 @@ module Jekyll
"detach" => false, # default to not detaching the server
"port" => "4000",
"host" => "127.0.0.1",
"baseurl" => "",
"baseurl" => nil, # this mounts at /, i.e. no subdirectory
"show_dir_listing" => false,
# Output Configuration

View File

@ -45,7 +45,7 @@ module Jekyll
end
def sanitized_baseurl
site.config["baseurl"].chomp("/")
site.config["baseurl"].to_s.chomp("/")
end
def ensure_leading_slash(input)