From 575b3178119018fb14fae0091a1330f5da0a9ad9 Mon Sep 17 00:00:00 2001 From: yuki Date: Sun, 7 Dec 2025 08:05:17 -0300 Subject: [PATCH] add pagination boilerplate --- _layouts/recent_feed.njk | 8 +++++++- en/blog/index.md | 4 ++++ es/blog/index.md | 8 ++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/_layouts/recent_feed.njk b/_layouts/recent_feed.njk index d824f02..4fa003f 100644 --- a/_layouts/recent_feed.njk +++ b/_layouts/recent_feed.njk @@ -13,8 +13,13 @@ {% endif %}
+ {% if paginated %} + {% set cycling = paginated | i18n_filter %} + {% else %} + {% set cycling = collections[cycling_tag] | i18n_filter %} + {% endif %} {% set current_year = 0 %} - {% for post in collections[cycling_tag] | i18n_filter %} + {% for post in cycling %} {% set post_year = post.date | date("yyyy") %} {% if post_year != current_year %}

{{ post_year }}

@@ -37,6 +42,7 @@

{{ "read-more" | i18n }}

{% endfor %} + {# TODO: handle pagination buttons #}
diff --git a/en/blog/index.md b/en/blog/index.md index 3a35201..3b0c4dd 100644 --- a/en/blog/index.md +++ b/en/blog/index.md @@ -3,6 +3,10 @@ title: blog layout: recent_feed cycling_tag: posts sidebar: blog +pagination: + data: collections.posts + size: 6 + alias: paginated flight: img: /img/gifcities/mimi.gif url: / diff --git a/es/blog/index.md b/es/blog/index.md index d110ca4..24715ff 100644 --- a/es/blog/index.md +++ b/es/blog/index.md @@ -3,9 +3,13 @@ title: blog layout: recent_feed cycling_tag: posts sidebar: blog +pagination: + data: collections.posts + size: 6 + alias: paginated flight: - img: /img/gifcities/mimi.gif - url: / + img: /img/gifcities/mimi.gif + url: / --- # blog