Created
October 15, 2015 07:32
-
-
Save tonydieu/8c1e4ea3e1eca1ecd2ff to your computer and use it in GitHub Desktop.
ligthbox shopify blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
{% if article.content contains "<img" %} | |
{% assign content-src = article.content | split: 'src="' %} | |
{% assign content-size = content-src.size | minus:1 %} | |
{% for i in (1..content-size) %} | |
{% assign src = content-src[i] | split: '"' | first | replace: '//cdn', 'http://cdn';;; | replace: 'http:http://';;;, 'http://';;; | remove: 'https:' %} | |
<a href="{{src}}" data-lightbox="{{article.id}}"> | |
{% if i == 1 %} | |
<img src="{{src}}"/> | |
{% endif %} | |
</a> | |
{% endfor %} | |
{% else %} | |
{% endif %} | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment