Jekyll loop images

loop images from site.static_files

Posted by Dongyupu on January 26, 2016

load all images in static_file

{:% for image in site.static_files %}
	{:% if image.path contains 'img/ARTMIA-curtain' %}
		{:% if image.extname == '.jpg' %}
			<a href="" title="">
			<div style="width:200px; height:365px; float:left; margin:3px 3px; display:inline; background-image:url(); background-repeat:no-repeat; background-size:auto;"></div>
			</a>
		{:% endif %}
	{:% endif %}
{:% endfor %}

if you have file list ,just use for loop

{:% for i in (1..98) %}
	<a href="/img/ARTMIA-curtain/.jpg">
	<div style="width:200px; height:356px; float:left; margin:3px 3px; display:inline; background-image:url(/img/ARTMIA-curtain/.jpg);"></div>
	</a>
{:% endfor %}