From 075fad74cbd09271da3130df3ef296190139e234 Mon Sep 17 00:00:00 2001 From: iBug Date: Tue, 17 Sep 2024 16:37:55 +0800 Subject: [PATCH] Use `include documents-collection.html` in `home` layout --- CHANGELOG.md | 1 + _includes/documents-collection.html | 4 ++-- _layouts/home.html | 4 +--- docs/_docs/18-history.md | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0956219cc45b..65ac79b81ddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Remove unnecessary "type" attribute (#4956) - The "if" means the default is never used (#4955) - For pages without a title, show the site title only once (#4959) +- Use `documents-collection.html` partial in `home` layout. ### Bug Fixes diff --git a/_includes/documents-collection.html b/_includes/documents-collection.html index bb19bfb60710..8c1d1279cb1d 100644 --- a/_includes/documents-collection.html +++ b/_includes/documents-collection.html @@ -1,4 +1,4 @@ -{% assign entries = site[include.collection] | where_exp: "post", "post.hidden != true" %} +{% assign entries = include.entries | default: site[include.collection] | where_exp: "post", "post.hidden != true" %} {% if include.sort_by %} {% assign entries = entries | sort: include.sort_by %} @@ -9,5 +9,5 @@ {% endif %} {%- for post in entries -%} - {% include archive-single.html %} + {% include archive-single.html type=include.type %} {%- endfor -%} diff --git a/_layouts/home.html b/_layouts/home.html index 02e96eb81ca1..384a4d9a3bb7 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -14,9 +14,7 @@

{{ site.data.ui-text[site.locale].recent_posts | d {% assign entries_layout = page.entries_layout | default: 'list' %}
- {% for post in posts %} - {% include archive-single.html type=entries_layout %} - {% endfor %} + {% include documents-collection.html entries=posts type=entries_layout %}
{% include paginator.html %} diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index 878e6e236271..1bf31c75e7b4 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -5,7 +5,7 @@ permalink: "/docs/history/" excerpt: Change log of enhancements and bug fixes made to the theme. sidebar: nav: docs -last_modified_at: '2024-08-20T17:04:07+08:00' +last_modified_at: '2024-09-17T16:37:54+08:00' toc: false --- @@ -25,6 +25,7 @@ toc: false - Remove unnecessary "type" attribute [#4956](https://github.com/mmistakes/minimal-mistakes/issues/4956) - The "if" means the default is never used [#4955](https://github.com/mmistakes/minimal-mistakes/issues/4955) - For pages without a title, show the site title only once [#4959](https://github.com/mmistakes/minimal-mistakes/issues/4959) +- Use `documents-collection.html` partial in `home` layout. ### Bug Fixes