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

24 lines
860 B
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 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 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></nav>
</div>