~xdavidwu/xdavidwu.link

fd227da9cb0a23941a3a6245a808448a34931c2c — Michael Rose 6 years ago 2969225
Add support to gallery helper for defining column layout

e.g. `{% include gallery id="gallery" layout="half" caption="2 column gallery caption" %}

Fixes #1821
2 files changed, 13 insertions(+), 5 deletions(-)

M CHANGELOG.md
M _includes/gallery
M CHANGELOG.md => CHANGELOG.md +4 -0
@@ 1,5 1,9 @@
## Unreleased

### Enhancements

* Add support to [gallery helper](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#gallery) for defining column layout (`half`, `third`, or single `''`). [#1821](https://github.com/mmistakes/minimal-mistakes/issues/1821)

### Bug Fixes

* Fix sidebar navigation list toggle. [#1819](https://github.com/mmistakes/minimal-mistakes/issues/1819)

M _includes/gallery => _includes/gallery +9 -5
@@ 4,12 4,16 @@
  {% assign gallery = page.gallery %}
{% endif %}

{% if gallery.size == 2 %}
  {% assign gallery_layout = 'half' %}
{% elsif gallery.size >= 3 %}
  {% assign gallery_layout = 'third' %}
{% if include.layout %}
  {% assign gallery_layout = include.layout %}
{% else %}
  {% assign gallery_layout = '' %}
  {% if gallery.size == 2 %}
    {% assign gallery_layout = 'half' %}
  {% elsif gallery.size >= 3 %}
    {% assign gallery_layout = 'third' %}
  {% else %}
    {% assign gallery_layout = '' %}
  {% endif %}
{% endif %}

<figure class="{{ gallery_layout }} {{ include.class }}">