2016-03-03 22:24:18 +01:00
|
|
|
{% if include.id %}
|
2017-09-05 03:14:36 +02:00
|
|
|
{% assign gallery = page[include.id] %}
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
|
|
|
{% assign gallery = page.gallery %}
|
|
|
|
{% endif %}
|
|
|
|
|
2018-09-10 16:24:24 +02:00
|
|
|
{% if include.layout %}
|
|
|
|
{% assign gallery_layout = include.layout %}
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2018-09-10 16:24:24 +02:00
|
|
|
{% if gallery.size == 2 %}
|
|
|
|
{% assign gallery_layout = 'half' %}
|
|
|
|
{% elsif gallery.size >= 3 %}
|
|
|
|
{% assign gallery_layout = 'third' %}
|
|
|
|
{% else %}
|
|
|
|
{% assign gallery_layout = '' %}
|
|
|
|
{% endif %}
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
|
|
|
|
2016-03-23 21:31:30 +01:00
|
|
|
<figure class="{{ gallery_layout }} {{ include.class }}">
|
2016-03-03 22:24:18 +01:00
|
|
|
{% for img in gallery %}
|
2016-03-06 03:29:08 +01:00
|
|
|
{% if img.url %}
|
2020-03-06 21:37:07 +01: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 %}">
|
2016-03-03 22:24:18 +01:00
|
|
|
</a>
|
|
|
|
{% else %}
|
2020-03-06 21:37:07 +01:00
|
|
|
<img src="{{ img.image_path | relative_url }}"
|
|
|
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% if include.caption %}
|
|
|
|
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
|
|
|
|
{% endif %}
|
2020-03-06 21:37:07 +01:00
|
|
|
</figure>
|