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 }}">