diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx
index 80a2f0c..9611625 100644
--- a/app/posts/[slug]/page.tsx
+++ b/app/posts/[slug]/page.tsx
@@ -4,7 +4,7 @@ import { ShareLinks } from '@/components/post/ShareLinks'
import { TableOfContents } from '@/components/post/TableOfContents'
import { getAllPostSlugs, getNextAndPreviousPosts, getPostBySlug } from '@/lib/posts'
import { slugify } from '@/utils/slug'
-import { Pencil, SendHorizonal } from 'lucide-react'
+import { ArrowLeft, ArrowRight, Pencil, SendHorizonal } from 'lucide-react'
import type { Metadata } from 'next'
import Link from 'next/link'
@@ -126,26 +126,39 @@ export default async function Post({ params }: { params: Promise<{ slug: string
/>
-
+
{previous ? (
- ← {previous.title}
+
+
+ Previous
+
+
+ {previous.title}
+
) : (
-
+
)}
+
{next ? (
- {next.title} →
+
+ Next
+
+
+
+ {next.title}
+
) : (
-
+
)}
diff --git a/lib/posts.tsx b/lib/posts.tsx
index 8bfa22a..04746cb 100644
--- a/lib/posts.tsx
+++ b/lib/posts.tsx
@@ -56,8 +56,8 @@ export function getNextAndPreviousPosts(slug: string): {
} {
const posts = getAllPostsMeta()
const index = posts.findIndex((post) => post.slug === slug)
- const next = index < posts.length - 1 ? posts[index + 1] : null
- const previous = index > 0 ? posts[index - 1] : null
+ const previous = index < posts.length - 1 ? posts[index + 1] : null
+ const next = index > 0 ? posts[index - 1] : null
return { next, previous }
}
@@ -99,9 +99,7 @@ export async function getPostBySlug(slug: string, postDirectory: string = postsD
img: ({ src, alt }: { src: string; alt: string }) =>
,
a: ({ href, children }: { href: string; children: ReactNode }) =>
href?.startsWith('http') ? (
-
- {children}
-
+
{children}
) : (
{children}
),