add pagination boilerplate

This commit is contained in:
yuki 2025-12-07 08:05:17 -03:00
parent fed5859a21
commit 575b317811
Signed by: yuki
GPG key ID: 0C98E6FF04EC3915
3 changed files with 17 additions and 3 deletions

View file

@ -13,8 +13,13 @@
</div>
{% endif %}
<div id="feed">
{% 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 %}
<h2 class="year-title">{{ post_year }}</h2>
@ -37,6 +42,7 @@
<p class="post-link"><a href="{{ post.url | locale_url_resolve }}">{{ "read-more" | i18n }}</a></p>
</div>
{% endfor %}
{# TODO: handle pagination buttons #}
<div class="end-of-feed">
<a href="https://www.youtube.com/watch?v=mB5YeQFw1S4" target="_blank">
<div id="tv"></div>

View file

@ -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: /

View file

@ -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