allow image to be an object

This commit is contained in:
Ben Balter 2016-04-19 09:55:34 -04:00
parent 0329f38b62
commit 2904bf9bab
1 changed files with 13 additions and 3 deletions

View File

@ -89,7 +89,7 @@
{% endif %}
{% if page.image %}
{% assign seo_page_image = page.image | prepend: seo_url | escape %}
{% assign seo_page_image = page.image.path | default: page.image.facebook | default: page.image | prepend: seo_url | escape %}
{% endif %}
{% if seo_tag.title and seo_title %}
@ -115,7 +115,17 @@
{% endif %}
{% if seo_page_image %}
<meta property="og:image" content="{{ seo_page_image }}" />
<meta property="og:image" content="{{ seo_page_image }}" />
{% if page.image.height %}
<meta property="og:image:height" content="{{ page.image.height }}" />
{% endif %}
{% if page.image.width %}
<meta property="og:image:width" content="{{ page.image.width }}" />
{% endif %}
{% endif %}
{% if page.image.twitter %}
<meta name="twitter:image" content="{{ page.image.twitter | prepend: seo_url | escape }}" />
{% endif %}
{% if page.date %}
@ -132,7 +142,7 @@
{% endif %}
{% if site.twitter %}
{% if seo_page_image %}
{% if seo_page_image or page.image.twitter %}
<meta name="twitter:card" content="summary_large_image" />
{% else %}
<meta name="twitter:card" content="summary" />