Skip to content

Commit

Permalink
Fix #567 allow CDN in development.
Browse files Browse the repository at this point in the history
  • Loading branch information
envygeeks committed Jul 14, 2020
1 parent 6a576a1 commit 056d2c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
2 changes: 1 addition & 1 deletion lib/jekyll/assets/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def prefix_url(user_path = nil)
url.scheme = "http"
end

if Jekyll.production? && cdn_url
if cdn_url
c_url = Addressable::URI.parse(cdn_url)

if c_url.host
Expand Down
53 changes: 0 additions & 53 deletions spec/tests/lib/jekyll/assets/utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,59 +427,6 @@
end
end
end

#

context "development" do
context "w/ asset_config[:cdn][:url]" do
let :cdn do
"https://my.cdn"
end

before do
stub_asset_config({
cdn: {
url: cdn,
},
})
end

#

it "doesn't use it" do
out = subject.prefix_url
destination = subject.asset_config[:destination]
expect(out).to eq(destination)
end
end

#

context "w/ jekyll.config[:baseurl]" do
before do
stub_jekyll_config({
baseurl: "hello",
})
end

#

it "uses it" do
out = subject.prefix_url
expect(out).to start_with("/hello")
end
end

#

context "w/ asset_config[:destination]" do
it "uses it" do
out = subject.prefix_url
destination = subject.asset_config[:destination]
expect(out).to eq(destination)
end
end
end
end

#
Expand Down

0 comments on commit 056d2c8

Please sign in to comment.