From f605c7d31b789beff8afcb24081d2f24ca0679cb Mon Sep 17 00:00:00 2001 From: Katy DeCorah Date: Mon, 28 Aug 2023 20:37:51 -0400 Subject: [PATCH] Fix logic to use `url` rather than `title` (title is not always unique) --- _includes/post/prev-next.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/_includes/post/prev-next.html b/_includes/post/prev-next.html index 9b396c5..d82360b 100644 --- a/_includes/post/prev-next.html +++ b/_includes/post/prev-next.html @@ -3,13 +3,15 @@ {% for category in site.categories %}{% assign catg_name = category.first %}{% if catg_name == page.categories[0] %}{% assign catg_posts = category.last %}{% endif %}{% endfor %}{% for post in catg_posts %}{% if - post.title == page.title %}{% unless forloop.last %}{% assign prev = + post.url == page.url %}{% unless forloop.last %}{% assign prev = catg_posts[forloop.index] %} {% include icons/chevron-left.svg %} Older {% endunless %}{% endif %}{% assign next = post %}{% endfor %}{% for post - in catg_posts %}{% if post.title == page.title %}{% unless forloop.first - %} + in catg_posts %}{% if post.url == page.url %}{% unless forloop.first %} Newer {% include icons/chevron-right.svg %}{% endunless %}{% endif %}{% assign next = post %}{% endfor %}