diff --git a/snippets/social-meta-tags.liquid b/snippets/social-meta-tags.liquid index 97d8f5571..f08035fba 100755 --- a/snippets/social-meta-tags.liquid +++ b/snippets/social-meta-tags.liquid @@ -25,8 +25,15 @@ {% elsif template contains 'article' %} + {% comment %} + Check to see if the Article has a featured image. + Otherwise check to see if the Article contains an image. + {% endcomment %} {% assign img_tag = '<' | append: 'img' %} - {% if article.content contains img_tag %} + {% if article.image %} + + + {% elsif article.content contains img_tag %} {% assign src = article.content | split: 'src="' %} {% assign src = src[1] | split: '"' | first | remove: 'https:' | remove: 'http:' %} {% if src %} @@ -76,10 +83,13 @@ {% comment %} - Check if content contains an image to add to the card + Check to see if the Article has a featured image. + Otherwise check to see if the Article contains an image. - Source: http://blog.viralica.com/2013/09/twitter-product-cards-on-shopify/ {% endcomment %} - {% if article.content contains " + {% elsif article.content contains "