diff --git a/lib/jekyll-seo-tag/drop.rb b/lib/jekyll-seo-tag/drop.rb index c69f70d..da6cf60 100644 --- a/lib/jekyll-seo-tag/drop.rb +++ b/lib/jekyll-seo-tag/drop.rb @@ -168,7 +168,8 @@ module Jekyll image["path"] ||= image["facebook"] || image["twitter"] return @image = nil unless image["path"] - unless absolute_url? image["path"] + # absolute_url? will return nil for an invalid URL + if absolute_url?(image["path"]) == false image["path"] = filters.absolute_url image["path"] end diff --git a/spec/jekyll_seo_tag/drop_spec.rb b/spec/jekyll_seo_tag/drop_spec.rb index 0fab884..35fa38b 100644 --- a/spec/jekyll_seo_tag/drop_spec.rb +++ b/spec/jekyll_seo_tag/drop_spec.rb @@ -563,7 +563,7 @@ RSpec.describe Jekyll::SeoTag::Drop do let(:image) { ":" } it "returns nil" do - expect(subject.image["path"]).to eql("/:") + expect(subject.image["path"]).to eql(":") end end