From 738f4efea7955a98c5640b3ea7f3ca932cb958f2 Mon Sep 17 00:00:00 2001 From: Bo Turnbow Date: Tue, 23 Feb 2016 11:54:52 -0700 Subject: [PATCH 1/4] Update twitter:image to output full url --- lib/template.html | 2 +- spec/jekyll_seo_tag_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/template.html b/lib/template.html index e21d56b..46968b4 100644 --- a/lib/template.html +++ b/lib/template.html @@ -118,7 +118,7 @@ {% if page.image %} - + {% endif %} {% if seo_author_twitter %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 1753804..2e04f7d 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -247,6 +247,16 @@ describe Jekyll::SeoTag do expect(output).to match(expected) end end + + context 'with page.image' do + let(:site) { make_site('twitter' => site_twitter, 'url' => 'http://example.invalid') } + let(:page) { make_page('image' => 'foo.png') } + + it 'outputs the image' do + expected = %r{} + expect(output).to match(expected) + end + end end end From b42501b45a3e111a57f4dc21cc15b53030bfa2dd Mon Sep 17 00:00:00 2001 From: Bo Turnbow Date: Tue, 23 Feb 2016 15:54:17 -0700 Subject: [PATCH 2/4] Per Ben Balter, change usage to a rooted image url --- lib/template.html | 2 +- spec/jekyll_seo_tag_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/template.html b/lib/template.html index 46968b4..7e01a10 100644 --- a/lib/template.html +++ b/lib/template.html @@ -118,7 +118,7 @@ {% if page.image %} - + {% endif %} {% if seo_author_twitter %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 2e04f7d..a607758 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -250,10 +250,10 @@ describe Jekyll::SeoTag do context 'with page.image' do let(:site) { make_site('twitter' => site_twitter, 'url' => 'http://example.invalid') } - let(:page) { make_page('image' => 'foo.png') } + let(:page) { make_page('image' => '/img/foo.png') } it 'outputs the image' do - expected = %r{} + expected = %r{} expect(output).to match(expected) end end From 2d0101bd1e514ede4c5824e129f08371613f5e01 Mon Sep 17 00:00:00 2001 From: Bo Turnbow Date: Tue, 23 Feb 2016 15:57:25 -0700 Subject: [PATCH 3/4] Change site logo to expect a rooted url --- lib/template.html | 2 +- spec/jekyll_seo_tag_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/template.html b/lib/template.html index 7e01a10..45d3aae 100644 --- a/lib/template.html +++ b/lib/template.html @@ -84,7 +84,7 @@ {% endif %} {% if page.image %} - + {% endif %} {% if page.date %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index a607758..880a5f8 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -111,10 +111,10 @@ describe Jekyll::SeoTag do end context 'with page.image' do - let(:page) { make_page('image' => 'foo.png') } + let(:page) { make_page('image' => '/img/foo.png') } it 'outputs the image' do - expected = %r{} + expected = %r{} expect(output).to match(expected) end end From b247d8bcbe32f027516f6a24f8c5dbe785938ad8 Mon Sep 17 00:00:00 2001 From: Bo Turnbow Date: Tue, 23 Feb 2016 15:57:38 -0700 Subject: [PATCH 4/4] Update docs for site logo and page image --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f713ce8..96e2042 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ The SEO tag will respect any of the following if included in your site's `_confi publisher: 1234 ``` -* `logo` - Relative URL to a site-wide logo (e.g., `assets/your-company-logo.png`) +* `logo` - Relative URL to a site-wide logo (e.g., `/assets/your-company-logo.png`) * `social` - For [specifying social profiles](https://developers.google.com/structured-data/customize/social-profiles). The following properties are available: * `type` - Either `person` or `organization` (defaults to `person`) * `name` - If the user or organization name differs from the site's name @@ -79,7 +79,7 @@ The SEO tag will respect the following YAML front matter if included in a post, * `title` - The title of the post, page, or document * `description` - A short description of the page's content -* `image` - Relative URL to an image associated with the post, page, or document (e.g., `assets/page-pic.jpg`) +* `image` - Relative URL to an image associated with the post, page, or document (e.g., `/assets/page-pic.jpg`) * `author` - Page-, post-, or document-specific author information (see below) ### Disabling `` output