Don't reset site.url to localhost:4000 by default (#7253)
Merge pull request 7253
This commit is contained in:
parent
9fbb7b57c9
commit
91a3dd9e6f
|
@ -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"],
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue