Skip to content

Commit 890ea22

Browse files
author
Chris D. Macrae
committed
Fix pagination direction
1 parent 262b435 commit 890ea22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/articles/[path].tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export const getStaticProps: GetStaticProps = async (context) => {
2525
}
2626

2727
const postIndex = posts?.findIndex(p => p.slug === post.slug);
28-
const prev = postIndex > -1 ? posts[postIndex - 1] : null;
29-
const next = postIndex > -1 ? posts[postIndex + 1] : null;
28+
const prev = postIndex > -1 ? posts[postIndex + 1] : null;
29+
const next = postIndex > -1 ? posts[postIndex - 1] : null;
3030

3131
props.post = post;
3232
if (next) props.next = next;

0 commit comments

Comments
 (0)