# About generating responsive image gallery from any folder

**URL:** <https://talk.jekyllrb.com/t/about-generating-responsive-image-gallery-from-any-folder/3196>\
**Category:** Help\
**Created:** [August 15, 2019, 2:22pm UTC](https://talk.jekyllrb.com/t/about-generating-responsive-image-gallery-from-any-folder/3196 "2019-08-15T14:22:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatihturan](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/fatihturan/32/1825_2.png) [@fatihturan](https://talk.jekyllrb.com/u/fatihturan)\
**Post date:** [August 15, 2019, 2:22pm UTC](https://talk.jekyllrb.com/t/about-generating-responsive-image-gallery-from-any-folder/3196/1 "2019-08-15T14:22:22Z")

</div>

Hi,

I created collection for portfolio contents in my Jekyll and I am currently able to list all images from any folder [with this guide](https://jekyllcodex.org/without-plugin/image-gallery/). But there are image files named with @2x for displaying sharp images on high density displays [like on this screenshot](https://cl.ly/f4df1164b706).

So how do I exclude @2x image files in gallery and put in `srcset=""` property in `<img>` tag for generating responsive image gallery.

* * *

This is my sample `.md` file:

```auto
---
layout: work-detail
---
{% include screenshot.html folder="/images-folder/" %}

```

This is include file for generating gallery:

```auto
<div class="screenshot screenshot--grid">
{% for file in site.static_files %}
  {% if file.path contains include.folder %}
    {% if file.extname == '.jpg' or 
      file.extname == '.jpeg' or 
      file.extname == '.JPG' or 
      file.extname == '.png' or 
      file.extname == '.PNG' or 
      file.extname == '.JPEG' %}

      {% assign filenameparts = file.path | split: "/" %}
      {% assign filename = filenameparts | last | replace: file.extname,"" %}
			<img src="{{ file.path }}" alt="">
    {% endif %}
  {% endif %}
{% endfor %}
</div>

```
