From 892506cf38b680cd495861668b3235dae0633b27 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 3 Mar 2016 22:28:12 +0100 Subject: [PATCH 1/3] Large image summary Twitter Card support A proposal to fix #68 --- lib/template.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/template.html b/lib/template.html index 93e3432..1606426 100644 --- a/lib/template.html +++ b/lib/template.html @@ -124,7 +124,13 @@ {% endif %} {% if site.twitter %} - + + {% if page.image %} + + {% elsif %} + + {% endif %} + {% if seo_author_twitter %} From 48af19f188eb09da0b6945a126aaa6dfedd2c6f4 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sat, 5 Mar 2016 19:29:49 +0100 Subject: [PATCH 2/3] feedback from @BenBalter --- lib/template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/template.html b/lib/template.html index 1606426..94fa146 100644 --- a/lib/template.html +++ b/lib/template.html @@ -127,7 +127,7 @@ {% if page.image %} - {% elsif %} + {% else %} {% endif %} From ad5add05403cc70de27607e67e30516b69eae4b8 Mon Sep 17 00:00:00 2001 From: Bo Turnbow Date: Sat, 5 Mar 2016 12:19:14 -0800 Subject: [PATCH 3/3] Add tests for large image Twitter card --- lib/template.html | 5 ++--- spec/jekyll_seo_tag_spec.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/template.html b/lib/template.html index ab31930..95ffae1 100644 --- a/lib/template.html +++ b/lib/template.html @@ -132,13 +132,12 @@ {% endif %} {% if site.twitter %} - - {% if page.image %} + {% if seo_page_image %} {% else %} {% endif %} - + {% if seo_author_twitter %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 0f1bf5f..b3fae8f 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -203,6 +203,9 @@ EOS let(:page) { make_page('author' => 'benbalter') } it 'outputs twitter card meta' do + expected = %r{} + expect(output).to match(expected) + expected = %r{} expect(output).to match(expected) @@ -241,6 +244,15 @@ EOS end end + context 'with page.image' do + let(:page) { make_page('image' => '/img/foo.png') } + + it 'outputs summary card with large image' do + expected = %r{} + expect(output).to match(expected) + end + end + context 'with page.author as a hash' do let(:page) { make_page('author' => { 'twitter' => '@test' }) }