From f92e5e9f17c6d7aa1ca92369b6277def50dda0dd Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Sat, 18 Nov 2023 16:10:08 -0600 Subject: [PATCH] Had to fix an issue with the get-last-5-posts function. It was providing the first 5 posts retrieved instead of the last --- utils/libs/blog-page.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/libs/blog-page.sh b/utils/libs/blog-page.sh index 9aa4cf2..618391c 100755 --- a/utils/libs/blog-page.sh +++ b/utils/libs/blog-page.sh @@ -37,8 +37,8 @@ function get_last_5_pages (){ VAR=( ${pages[@]} ) else ## Otherwise, itterate through the last 5 blog posts - INDEX=-5 - while [[ $INDEX -ne 0 ]]; do + INDEX=0 + while [[ $INDEX -ne 5 ]]; do VAR+=( "${pages[$INDEX]}" ) ## Increment the index so that we get closer and closer to end of the list ((INDEX++))