From 65820ada36a566c9af38bc99c6e34b3ba8635780 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 2 May 2017 09:41:18 -0400 Subject: [PATCH 1/2] Add failing test for https://github.com/jekyll/jekyll-seo-tag/issues/202 --- spec/jekyll_seo_tag/drop_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/jekyll_seo_tag/drop_spec.rb b/spec/jekyll_seo_tag/drop_spec.rb index cf6c5da..c38b2a0 100644 --- a/spec/jekyll_seo_tag/drop_spec.rb +++ b/spec/jekyll_seo_tag/drop_spec.rb @@ -261,6 +261,15 @@ RSpec.describe Jekyll::SeoTag::Drop do end end + # See https://github.com/jekyll/jekyll-seo-tag/issues/202 + context "without an author name or handle" do + let(:page_meta) { { "author" => { "foo" => "bar" } } } + + it "dosen't blow up" do + expect(subject.author["twitter"]).to be_nil + end + end + context "with an explicit handle" do let(:page_meta) do { From 4f80ea50b773d1995985e35a8a63806516c353c4 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 2 May 2017 09:42:21 -0400 Subject: [PATCH 2/2] fix for calling delete! on NiLClass --- lib/jekyll-seo-tag/drop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll-seo-tag/drop.rb b/lib/jekyll-seo-tag/drop.rb index 06fe3a2..228bc3c 100644 --- a/lib/jekyll-seo-tag/drop.rb +++ b/lib/jekyll-seo-tag/drop.rb @@ -88,7 +88,7 @@ module Jekyll end author["twitter"] ||= author["name"] - author["twitter"].delete! "@" + author["twitter"].delete! "@" if author["twitter"] author.to_liquid end end