diff --git a/src/components/layout/BlogNavigation.astro b/src/components/layout/BlogNavigation.astro index 09fc20f..e67985d 100644 --- a/src/components/layout/BlogNavigation.astro +++ b/src/components/layout/BlogNavigation.astro @@ -64,8 +64,8 @@ const sortedPosts = posts const currentIndex = sortedPosts.findIndex((post) => post.slug === currentSlug); -const nextPost = currentIndex > 0 ? sortedPosts[currentIndex - 1] : null; -const prevPost = currentIndex < sortedPosts.length - 1 ? sortedPosts[currentIndex + 1] : null; +const nextPost = currentIndex < sortedPosts.length - 1 ? sortedPosts[currentIndex + 1] : null; +const prevPost = currentIndex > 0 ? sortedPosts[currentIndex - 1] : null; const prevText = lang === 'zh' ? '上一篇' : 'Previous Post'; const nextText = lang === 'zh' ? '下一篇' : 'Next Post';