Skip to content

Commit 715686e

Browse files
fix: pagination setup on author auto pages (#94)
1 parent 0f44762 commit 715686e

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

_layouts/autopage_author.html

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,27 @@ <h1 class="text-2xl font-sans text-navysciam font-bold">{{ author.name }}</h1>
101101
<div class="bg-white py-10 px-14 rounded-lg shadow-md">
102102
<h2 class="text-2xl font-sans text-navysciam font-bold my-4">Articles publi&eacute;s</h2>
103103
<div>
104-
{% for post in site.posts %}
105-
{% if author_username == post.author or post.auteurs contains author_username %}
106-
{% include postbox.html %}
107-
<br>
108-
{% endif %}
104+
{% for post in paginator.posts %}
105+
{% include postbox.html %}
106+
<br>
109107
{% endfor %}
110108
</div>
111109
</div>
110+
111+
{% if paginator.total_pages > 1 %}
112+
<ul class="flex justify-center list-none mt-6">
113+
{% if paginator.previous_page %}
114+
<li class="mx-2">
115+
<a class="bg-gray-200 hover:bg-gray-300 text-black py-2 px-4 rounded"
116+
href="{{ paginator.previous_page_path | relative_url | replace: '//', '/' }}">&larr; Articles précédents</a>
117+
</li>
118+
{% endif %}
119+
{% if paginator.next_page %}
120+
<li class="mx-2">
121+
<a class="bg-gray-200 hover:bg-gray-300 text-black py-2 px-4 rounded"
122+
href="{{ paginator.next_page_path | relative_url | replace: '//', '/' }}">Articles suivants &rarr;</a>
123+
</li>
124+
{% endif %}
125+
</ul>
126+
{% endif %}
112127
</div>

0 commit comments

Comments
 (0)