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 %}
|
|
|
|
|
2016-07-20 22:05:31 +02:00
|
|
|
{% if gallery.size == 2 %}
|
2016-03-23 21:31:30 +01:00
|
|
|
{% assign gallery_layout = 'half' %}
|
2016-07-20 22:05:31 +02:00
|
|
|
{% elsif gallery.size >= 3 %}
|
2016-03-23 21:31:30 +01:00
|
|
|
{% assign gallery_layout = 'third' %}
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2016-03-23 21:31:30 +01:00
|
|
|
{% assign gallery_layout = '' %}
|
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 %}
|
2016-03-03 22:24:18 +01:00
|
|
|
<a href=
|
2016-06-03 17:59:19 +02:00
|
|
|
{% if img.url contains "://" %}
|
2016-03-06 03:29:08 +01:00
|
|
|
"{{ img.url }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2018-03-20 16:35:36 +01:00
|
|
|
"{{ img.url | relative_url }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
2016-06-02 03:26:14 +02:00
|
|
|
{% if img.title %}title="{{ img.title }}"{% endif %}
|
2016-03-03 22:24:18 +01:00
|
|
|
>
|
|
|
|
<img src=
|
2016-06-03 17:59:19 +02:00
|
|
|
{% if img.image_path contains "://" %}
|
2016-03-06 03:29:08 +01:00
|
|
|
"{{ img.image_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2018-03-20 16:35:36 +01:00
|
|
|
"{{ img.image_path | relative_url }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
2016-06-02 03:26:14 +02:00
|
|
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
2016-03-03 22:24:18 +01:00
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<img src=
|
2016-06-03 17:59:19 +02:00
|
|
|
{% if img.image_path contains "://" %}
|
2016-03-06 03:29:08 +01:00
|
|
|
"{{ img.image_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2018-03-20 16:35:36 +01:00
|
|
|
"{{ img.image_path | relative_url }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
2016-06-02 03:26:14 +02:00
|
|
|
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 %}
|
|
|
|
</figure>
|