2019-03-28 19:40:33 -04:00
|
|
|
{% if include.id %}
|
|
|
|
{% assign gallery = page[include.id] %}
|
|
|
|
{% else %}
|
|
|
|
{% assign gallery = page.gallery %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if include.layout %}
|
|
|
|
{% assign gallery_layout = include.layout %}
|
|
|
|
{% else %}
|
|
|
|
{% if gallery.size == 2 %}
|
|
|
|
{% assign gallery_layout = 'half' %}
|
|
|
|
{% elsif gallery.size >= 3 %}
|
|
|
|
{% assign gallery_layout = 'third' %}
|
|
|
|
{% else %}
|
|
|
|
{% assign gallery_layout = '' %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<figure class="{{ gallery_layout }} {{ include.class }}">
|
|
|
|
{% for img in gallery %}
|
|
|
|
{% if img.url %}
|
2023-02-10 04:44:06 -05:00
|
|
|
<a href="{{ img.url | relative_url }}"
|
|
|
|
{% if img.title %}title="{{ img.title }}"{% endif %}>
|
|
|
|
<img src="{{ img.image_path | relative_url }}"
|
|
|
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
2019-03-28 19:40:33 -04:00
|
|
|
</a>
|
|
|
|
{% else %}
|
2023-02-10 04:44:06 -05:00
|
|
|
<img src="{{ img.image_path | relative_url }}"
|
|
|
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
2019-03-28 19:40:33 -04:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% if include.caption %}
|
|
|
|
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
|
|
|
|
{% endif %}
|
2023-02-10 04:44:06 -05:00
|
|
|
</figure>
|