Update JSON-LD output to current usage for site logo and page image

This commit is contained in:
Bo Turnbow 2016-02-26 16:13:29 -07:00
parent ebfe8418aa
commit 4cb0b75bfa
2 changed files with 5 additions and 4 deletions

View File

@ -169,7 +169,7 @@
{% endif %}
{% if page.image %}
"image": {{ page.image | jsonify }},
"image": {{ page.image | prepend: seo_url | jsonify }},
{% endif %}
{% if page.date %}
@ -181,7 +181,7 @@
{% endif %}
{% if site.logo %}
"logo": {{ site.logo | prepend: "/" | prepend: seo_url | jsonify }},
"logo": {{ site.logo | prepend: seo_url | jsonify }},
{% endif %}
{% if seo_links %}

View File

@ -120,7 +120,7 @@ describe Jekyll::SeoTag do
end
context 'with site.logo' do
let(:site) { make_site('logo' => 'logo.png', 'url' => 'http://example.invalid') }
let(:site) { make_site('logo' => '/logo.png', 'url' => 'http://example.invalid') }
it 'outputs the logo' do
expect(json_data['logo']).to eql('http://example.invalid/logo.png')
@ -162,6 +162,7 @@ EOS
context 'posts' do
context 'with post meta' do
let(:site) { make_site('url' => 'http://example.invalid') }
let(:meta) do
{
'title' => 'post',
@ -177,7 +178,7 @@ EOS
expect(json_data['headline']).to eql('post')
expect(json_data['description']).to eql('description')
expect(json_data['image']).to eql('/img.png')
expect(json_data['image']).to eql('http://example.invalid/img.png')
end
it 'minifies JSON-LD' do