Browse Source

add gallery shortcode

main
xenua 2 years ago
parent
commit
b7cba51048
  1. 16
      templates/shortcodes/gallery.html

16
templates/shortcodes/gallery.html

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
{# {{ gallery(images=[], cols=2, caption="") }} #}
{% if not cols %}
{% set cols = 2 %}
{% endif %}
<figure>
<div class="gallery{{cols}}">
{% for image in images %}
{% set url = image | first %}
{% set alt = image | last %}
<img src="{{ get_url(path=url) }}" alt="{{ alt }}" title="{{ alt }}">
{% endfor %}
</div>
{% if caption %}<figcaption>{{ caption }}</figcaption>{% endif %}
</figure>
Loading…
Cancel
Save