Guide_Wii/_includes/gallery

36 lines
1.1 KiB
Text
Raw Normal View History

2016-10-30 01:02:14 +02:00
{% if include.id %}
2017-10-28 21:58:34 +02:00
{% assign gallery = page[include.id] %}
2016-10-30 01:02:14 +02:00
{% else %}
{% assign gallery = page.gallery %}
{% endif %}
{% if include.layout %}
{% assign gallery_layout = include.layout %}
2016-10-30 01:02:14 +02:00
{% else %}
{% if gallery.size == 2 %}
{% assign gallery_layout = 'half' %}
{% elsif gallery.size >= 3 %}
{% assign gallery_layout = 'third' %}
{% else %}
{% assign gallery_layout = '' %}
{% endif %}
2016-10-30 01:02:14 +02:00
{% endif %}
<figure class="{{ gallery_layout }} {{ include.class }}">
{% for img in gallery %}
{% if img.url %}
<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-10-30 01:02:14 +02:00
</a>
{% else %}
<img src="{{ img.image_path | relative_url }}"
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
2016-10-30 01:02:14 +02:00
{% endif %}
{% endfor %}
{% if include.caption %}
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
{% endif %}
</figure>