I am at my wits end. I’m developing a GitHub Pages site using Jekyll. Im new at Jekyll but get the basic principles. The problem I’m having happens locally and also when published on GitHub pages. I get duplicate thumbnails in an image gallery Im trying to get working. They duplicate only twice, which is extra weird.
The offending page is at: Galleries | Smart Learning : Activities & Ideas
My repo is at GitHub - Penworks/smartlearning: record of work done
I’m implementing a simple gallery - without any plugins - using the method from Damien Farrell, similar to the WaywardMark method (but that’s slightly different). Im currently testing so have two different galleries on the galleries.md page. Both galleries have the same problem.
I’ve edited the urls of the Damien Farrell code to work with my site and they parse correctly. There are no loose tags or non-closed loops. I just cannot work out what I’m doing wrong.
config.yml urls
imagesurl: "/assets/galleries/"
thumbsurl: "/assets/thumbs/"
Code in the gallery.html include
<div class="image-gallery">
{% assign sorted = site.static_files | sort: 'date' | reverse %}
{% for file in sorted %}
{% if file.path contains include.folder %}
{% if file.extname == '.jpg' or file.extname == '.png' %}
{% assign filenameparts = file.path %}
{% assign filename = filenameparts | last | replace: file.extname,"" %}
<div class="box">
<a href="{{site.baseurl}}{{ site.imagesurl }}{{ include.folder }}/{{ file.name }}" title="{{ filename }}"><img src="{{site.baseurl}}{{ site.thumbsurl }}{{ include.folder }}/{{ file.name }}" alt="{{ filename }}" class="img-gallery" /></a>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
Code in the galleries.md
## Literary London Images
{% include gallery.html folder="literary-london-ar" %}
## Malta Democracy Images
{% include gallery.html folder="malta-democracy-ar" %}
I am totally baffled by this problem.