Fix issue #183 image.itemtype
This commit is contained in:
parent
5b2e8f31ca
commit
533c6502f2
|
@ -223,7 +223,16 @@
|
|||
{% endif %}
|
||||
|
||||
{% if seo_page_image %}
|
||||
{% if page.image.height && page.image.width %}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": {{ seo_page_image | jsonify }},
|
||||
"height": {{ page.image.height | jsonify }},
|
||||
"width": {{ page.image.width | jsonify }}
|
||||
},
|
||||
{% else %}
|
||||
"image": {{ seo_page_image | jsonify }},
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.date %}
|
||||
|
|
|
@ -195,6 +195,10 @@ describe Jekyll::SeoTag do
|
|||
expected = %r!<meta property="og:image" content="http://example.invalid/img/foo.png" />!
|
||||
expect(output).to match(expected)
|
||||
end
|
||||
|
||||
it "outputs the default image JSON item" do
|
||||
expect(json_data["image"]).to eql("http://example.invalid/img/foo.png")
|
||||
end
|
||||
end
|
||||
|
||||
context "when given a facebook image" do
|
||||
|
@ -225,6 +229,12 @@ describe Jekyll::SeoTag do
|
|||
expected = %r!<meta property="og:image:width" content="2" />!
|
||||
expect(output).to match(expected)
|
||||
end
|
||||
|
||||
it "outputs the default image JSON object with dimensions" do
|
||||
expect(json_data["image"]["url"]).to eql("http://example.invalid/img/foo.png")
|
||||
expect(json_data["image"]["height"]).to eql(1)
|
||||
expect(json_data["image"]["width"]).to eql(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue