Update twitter:image to output full url
This commit is contained in:
parent
507c498267
commit
738f4efea7
|
@ -118,7 +118,7 @@
|
|||
<meta name="twitter:description" content="{{ seo_description }}" />
|
||||
|
||||
{% if page.image %}
|
||||
<meta name="twitter:image" content="{{ page.image | escape }}" />
|
||||
<meta name="twitter:image" content="{{ page.image | prepend: "/" | prepend: seo_url | escape }}" />
|
||||
{% endif %}
|
||||
|
||||
{% if seo_author_twitter %}
|
||||
|
|
|
@ -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{<meta name="twitter:image" content="http://example.invalid/foo.png" />}
|
||||
expect(output).to match(expected)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue