2016-03-07 16:27:07 +01:00
|
|
|
{% include base_path %}
|
2016-03-03 22:24:18 +01:00
|
|
|
|
|
|
|
{% if include.id %}
|
|
|
|
{% assign gallery = page.[include.id] %}
|
|
|
|
{% else %}
|
|
|
|
{% assign gallery = page.gallery %}
|
|
|
|
{% endif %}
|
|
|
|
|
2016-03-23 21:31:30 +01:00
|
|
|
{% capture gallery_size %}{{ gallery | size }}{% endcapture %}
|
2016-03-03 22:24:18 +01:00
|
|
|
|
2016-03-23 21:31:30 +01:00
|
|
|
{% if gallery_size == '2' %}
|
|
|
|
{% assign gallery_layout = 'half' %}
|
|
|
|
{% elsif gallery_size >= '3' %}
|
|
|
|
{% 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-03-06 03:29:08 +01:00
|
|
|
{% if img.url contains "http" %}
|
|
|
|
"{{ img.url }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2016-03-07 16:27:07 +01:00
|
|
|
"{{ img.url | prepend: "/images/" | prepend: base_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
|
|
|
>
|
|
|
|
<img src=
|
2016-03-06 03:29:08 +01:00
|
|
|
{% if img.image_path contains "http" %}
|
|
|
|
"{{ img.image_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2016-03-07 16:27:07 +01:00
|
|
|
"{{ img.image_path | prepend: "/images/" | prepend: base_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
|
|
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
|
|
|
</a>
|
|
|
|
{% else %}
|
|
|
|
<img src=
|
2016-03-06 03:29:08 +01:00
|
|
|
{% if img.image_path contains "http" %}
|
|
|
|
"{{ img.image_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% else %}
|
2016-03-07 16:27:07 +01:00
|
|
|
"{{ img.image_path | prepend: "/images/" | prepend: base_path }}"
|
2016-03-03 22:24:18 +01:00
|
|
|
{% endif %}
|
|
|
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% if include.caption %}
|
|
|
|
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
|
|
|
|
{% endif %}
|
|
|
|
</figure>
|