From 7cab0247ed14f17080b906908788ce9031eb9381 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 22 Aug 2017 11:53:18 -0400 Subject: [PATCH 1/2] fix for image.path causing an invalid url error --- lib/jekyll-seo-tag/drop.rb | 3 ++- spec/jekyll_seo_tag/drop_spec.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 From 3fca8b4cca1162a2af870b9ede59156a4f0cd853 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 22 Aug 2017 13:02:50 -0400 Subject: [PATCH 2/2] Update for #228 --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index fe18398..edfe7d8 100644 --- a/History.markdown +++ b/History.markdown @@ -1,6 +1,7 @@ ## HEAD * Use canonical_url specified in page if present #211 +* Fix for image.path causing an invalid url error #228 ## 2.2.3