50 lines
1.4 KiB
Text
50 lines
1.4 KiB
Text
|
{% include absolute-url.liquid %}
|
||
|
|
||
|
{% if include.id %}
|
||
|
{% assign gallery = page.[include.id] %}
|
||
|
{% else %}
|
||
|
{% assign gallery = page.gallery %}
|
||
|
{% endif %}
|
||
|
|
||
|
{% capture gallery-size %}{{ gallery | size }}{% endcapture %}
|
||
|
|
||
|
{% if gallery-size == '2' %}
|
||
|
{% assign gallery-layout = 'half' %}
|
||
|
{% elsif gallery-size >= '3' %}
|
||
|
{% assign gallery-layout = 'third' %}
|
||
|
{% else %}
|
||
|
{% assign gallery-layout = '' %}
|
||
|
{% endif %}
|
||
|
|
||
|
<figure class="{{ gallery-layout }}">
|
||
|
{% for img in gallery %}
|
||
|
{% if img.large %}
|
||
|
<a href=
|
||
|
{% if img.large contains "http" %}
|
||
|
"{{ img.large }}"
|
||
|
{% else %}
|
||
|
"{{ img.large | prepend: "/images/" | prepend: absurl }}"
|
||
|
{% endif %}
|
||
|
>
|
||
|
<img src=
|
||
|
{% if img.thumb contains "http" %}
|
||
|
"{{ img.thumb }}"
|
||
|
{% else %}
|
||
|
"{{ img.thumb | prepend: "/images/" | prepend: absurl }}"
|
||
|
{% endif %}
|
||
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
||
|
</a>
|
||
|
{% else %}
|
||
|
<img src=
|
||
|
{% if img.thumb contains "http" %}
|
||
|
"{{ img.thumb }}"
|
||
|
{% else %}
|
||
|
"{{ img.thumb | prepend: "/images/" | prepend: absurl }}"
|
||
|
{% endif %}
|
||
|
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
|
||
|
{% endif %}
|
||
|
{% endfor %}
|
||
|
{% if include.caption %}
|
||
|
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
|
||
|
{% endif %}
|
||
|
</figure>
|