jekyll-theme-isabelline/_includes/gallery.html

29 lines
1.0 KiB
HTML
Raw Normal View History

2020-09-07 02:09:23 +00:00
{% assign gallery_name = include.name | default: "gallery" %}
2020-09-01 01:06:29 +00:00
2020-09-07 02:09:23 +00:00
{% assign gallery_prefix = page.id | prepend: "/assets" | append: "/" | append: gallery_name %}
{% assign sorted_static_files = site.static_files | map: "path" | sort %}
2020-09-10 03:09:57 +00:00
{% assign valid_image_extensions = "jpg,jpeg,png,gif" | split: "," %}
2020-09-07 02:09:23 +00:00
<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 %}
2020-09-10 03:09:57 +00:00
{% if valid_image_extensions contains image_ext %}
2020-09-07 02:09:23 +00:00
{% if image_path contains gallery_prefix %}
{% assign image_index = image_index | plus: 1 %}
2020-09-07 14:00:23 +00:00
<img id="{{ gallery_name }}-{{ image_index }}" src="{{ site.baseurl }}{{ image_path }}" />
2020-09-07 02:09:23 +00:00
{% endif %}
{% endif %}
{% endfor %}
</div>
2020-09-07 14:00:23 +00:00
<nav>
<div class="play">
2020-09-07 16:49:16 +00:00
<input type="checkbox" checked="false" id="{{ gallery_name }}-play" />
2020-09-07 14:00:23 +00:00
<label for="{{ gallery_name }}-play"></label>
</div>
</nav>
2020-09-01 01:06:29 +00:00
</div>