Skip to content

Commit

Permalink
Further changes to make pagination actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter committed Jul 14, 2024
1 parent f08142c commit 79bc55e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions content/posts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ sort_by = "date"
paginate_by = 5
insert_anchor_links = "right"
generate_feed = true
transparent = true
+++
5 changes: 2 additions & 3 deletions templates/partials/home_posts.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% set posts = get_section(path="posts/_index.md") %}
{% for page in posts.pages | slice(end=10) %}
{% for page in paginator.pages %}
<article class="post-entry">
<header class="entry-header">
<h2>{{ page.title }}</h2>
Expand All @@ -16,7 +15,7 @@ <h2>{{ page.title }}</h2>
</article>
{% endfor %}

{% if posts.pages | length > 5 %}
{% if paginator %}
<footer class="page-footer">
<nav class="pagination">
{% if paginator.previous %}
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/post_nav_links.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set posts_section = get_section(path="posts/_index.md") %}
{% set posts_section = get_section(path="_index.md") %}
{% set num_posts = posts_section | length %}
{% if num_posts > 1 %}
<nav class="paginav">
Expand Down

0 comments on commit 79bc55e

Please sign in to comment.