From d57fe1de2c17e1760ca623339df2bed8948accc9 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 4 Aug 2020 12:59:44 -0400 Subject: [PATCH] Fix `entries_layout: grid` Close #2639 --- _includes/archive-single.html | 2 +- _layouts/categories.html | 5 +++-- _layouts/category.html | 5 +++-- _layouts/collection.html | 5 +++-- _layouts/posts.html | 5 +++-- _layouts/tag.html | 5 +++-- _layouts/tags.html | 5 +++-- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/_includes/archive-single.html b/_includes/archive-single.html index ef460998..df4f8dfc 100644 --- a/_includes/archive-single.html +++ b/_includes/archive-single.html @@ -10,7 +10,7 @@ {% assign title = post.title %} {% endif %} -
+
{% if include.type == "grid" and teaser %}
diff --git a/_layouts/categories.html b/_layouts/categories.html index aa2c6e80..f5448a29 100644 --- a/_layouts/categories.html +++ b/_layouts/categories.html @@ -25,14 +25,15 @@ layout: archive {% endfor %} +{% assign entries_layout = page.entries_layout | default: 'list' %} {% for i in (1..categories_max) reversed %} {% for category in site.categories %} {% if category[1].size == i %}

{{ category[0] }}

-
+
{% for post in category.last %} - {% include archive-single.html type=page.entries_layout %} + {% include archive-single.html type=entries_layout %} {% endfor %}
{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑ diff --git a/_layouts/category.html b/_layouts/category.html index 79b81ce0..b281c856 100644 --- a/_layouts/category.html +++ b/_layouts/category.html @@ -4,6 +4,7 @@ layout: archive {{ content }} -
- {% include posts-category.html taxonomy=page.taxonomy type=page.entries_layout %} +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% include posts-category.html taxonomy=page.taxonomy type=entries_layout %}
diff --git a/_layouts/collection.html b/_layouts/collection.html index 3bcd916a..d23d0c72 100644 --- a/_layouts/collection.html +++ b/_layouts/collection.html @@ -4,6 +4,7 @@ layout: archive {{ content }} -
- {% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout %} +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=entries_layout %}
diff --git a/_layouts/posts.html b/_layouts/posts.html index 95072ce0..13fc707c 100644 --- a/_layouts/posts.html +++ b/_layouts/posts.html @@ -15,13 +15,14 @@ layout: archive {% endfor %} +{% assign entries_layout = page.entries_layout | default: 'list' %} {% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %} {% for year in postsByYear %}

{{ year.name }}

-
+
{% for post in year.items %} - {% include archive-single.html type=page.entries_layout %} + {% include archive-single.html type=entries_layout %} {% endfor %}
{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑ diff --git a/_layouts/tag.html b/_layouts/tag.html index 5f83c2aa..8b1c1885 100644 --- a/_layouts/tag.html +++ b/_layouts/tag.html @@ -4,6 +4,7 @@ layout: archive {{ content }} -
- {% include posts-tag.html taxonomy=page.taxonomy type=page.entries_layout %} +{% assign entries_layout = page.entries_layout | default: 'list' %} +
+ {% include posts-tag.html taxonomy=page.taxonomy type=entries_layout %}
diff --git a/_layouts/tags.html b/_layouts/tags.html index 128e176e..daa11828 100644 --- a/_layouts/tags.html +++ b/_layouts/tags.html @@ -25,14 +25,15 @@ layout: archive {% endfor %} +{% assign entries_layout = page.entries_layout | default: 'list' %} {% for i in (1..tags_max) reversed %} {% for tag in site.tags %} {% if tag[1].size == i %}

{{ tag[0] }}

-
+
{% for post in tag.last %} - {% include archive-single.html type=page.entries_layout %} + {% include archive-single.html type=entries_layout %} {% endfor %}
{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑