Don't reset site.url to localhost:4000 by default (#7253)

Merge pull request 7253
This commit is contained in:
Ashwin Maroli 2020-11-11 18:29:44 +05:30 committed by GitHub
parent 9fbb7b57c9
commit 91a3dd9e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -249,6 +249,9 @@ module Jekyll
def default_url(opts)
config = configuration_from_options(opts)
auth = config.values_at("host", "port").join(":")
return config["url"] if auth == "127.0.0.1:4000"
format_url(
config["ssl_cert"] && config["ssl_key"],
config["host"] == "127.0.0.1" ? "localhost" : config["host"],

View File

@ -232,12 +232,6 @@ class TestCommandsServe < JekyllUnitTest
expect(Jekyll).to receive(:env).and_return("development")
expect(Jekyll::Commands::Serve).to receive(:start_up_webrick)
end
should "set the site url by default to `http://localhost:4000`" do
@merc.execute(:serve, "watch" => false, "url" => "https://jekyllrb.com/")
assert_equal 1, Jekyll.sites.count
assert_equal "http://localhost:4000", Jekyll.sites.first.config["url"]
end
should "take `host`, `port` and `ssl` into consideration if set" do
@merc.execute(:serve,