diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5f0af40c2d..97fe7af9e77c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/_includes/gallery b/_includes/gallery index ab2fd618ecf8..97022aa881da 100644 --- a/_includes/gallery +++ b/_includes/gallery @@ -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 %}