DanWebb
8/26/2015 - 7:50 AM

Extract an image src from an article excerpt

Extract an image src from an article excerpt

{% comment %}

	This include requires you to pass in the an article excerpt 
	which contains a single image. 

	Example: {% include 'excerpt_image' with article.excerpt %}

{% endcomment %}

{% assign src = excerpt_image | split: 'src="' %}
{% assign src = src[1] | split: '"' %}
{% assign src = src[0] %}
{{ src }}