From a43b8b5c9a58c3013de5f84a63ec27bcf593e6ea Mon Sep 17 00:00:00 2001 From: Hamza Date: Sun, 7 May 2023 22:59:30 +0200 Subject: [PATCH] post entries in home --- _layouts/home.html | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/_layouts/home.html b/_layouts/home.html index c53bbd4..bb85e94 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -4,14 +4,15 @@ {{ content }} -
- {%- if site.plugins contains 'jekyll-paginate' and page.paginate or site.gems contains 'jekyll-paginate' and page.paginate -%} - {%- comment -%} - Add paginator.posts loop if jekyll-paginate plugin is enabled - and page.paginate == true - {%- endcomment -%} - {% include posts-paginated.html %} - {%- else -%} - {% include posts-limit.html %} - {%- endif -%} -
+{% assign postsByYear = site.posts | group_by_exp: 'post', 'post.date | date: "%Y"' %} +{% for year in postsByYear %} +
+

{{ year.name }}

+
+ {% for entry in year.items %} + {% include entry.html %} + {% endfor %} +
+ {{ site.data.text[site.locale].back_to_top | default: 'Back to Top' }} ↑ +
+{% endfor %}