jekyll-theme-isabelline/_includes/gallery.html
2020-09-09 23:09:57 -04:00

29 lines
1.0 KiB
HTML

{% assign gallery_name = include.name | default: "gallery" %}
{% assign gallery_prefix = page.id | prepend: "/assets" | append: "/" | append: gallery_name %}
{% assign sorted_static_files = site.static_files | map: "path" | sort %}
{% assign valid_image_extensions = "jpg,jpeg,png,gif" | split: "," %}
<div class="gallery" id="gallery-{{ gallery_name }}">
{% assign image_index = 0 %}
{% assign gallery_nav = "" %}
<div class="images">
{% for image_path in sorted_static_files %}
{% assign image_ext = image_path | split: "." | last %}
{% if valid_image_extensions contains image_ext %}
{% if image_path contains gallery_prefix %}
{% assign image_index = image_index | plus: 1 %}
<img id="{{ gallery_name }}-{{ image_index }}" src="{{ site.baseurl }}{{ image_path }}" />
{% endif %}
{% endif %}
{% endfor %}
</div>
<nav>
<div class="play">
<input type="checkbox" checked="false" id="{{ gallery_name }}-play" />
<label for="{{ gallery_name }}-play"></label>
</div>
</nav>
</div>