Skip to content

Commit 792c078

Browse files
committed
fix : 이전 포스트, 다음 포스트 반대
1 parent ebf07d9 commit 792c078

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/templates/blog-post.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ const BlogPostTemplate: React.FC<BlogPostTemplateProps> = ({
122122
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
123123
{/* 이전 포스트 */}
124124
<div className="md:justify-self-start">
125-
{next && (
126-
<Link to={next.fields.slug} rel="prev" className="group block">
125+
{previous && (
126+
<Link
127+
to={previous.fields.slug}
128+
rel="prev"
129+
className="group block"
130+
>
127131
<div className="bg-card hover:bg-card/80 border rounded-lg p-6 transition-colors duration-200">
128132
<div className="flex items-start space-x-3">
129133
<div className="flex-shrink-0 p-2 bg-muted rounded-full group-hover:bg-muted/80 transition-colors">
@@ -134,7 +138,7 @@ const BlogPostTemplate: React.FC<BlogPostTemplateProps> = ({
134138
이전 포스트
135139
</p>
136140
<h3 className="font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2">
137-
{next.frontmatter.title}
141+
{previous.frontmatter.title}
138142
</h3>
139143
</div>
140144
</div>
@@ -145,20 +149,16 @@ const BlogPostTemplate: React.FC<BlogPostTemplateProps> = ({
145149

146150
{/* 다음 포스트 */}
147151
<div className="md:justify-self-end">
148-
{previous && (
149-
<Link
150-
to={previous.fields.slug}
151-
rel="next"
152-
className="group block"
153-
>
152+
{next && (
153+
<Link to={next.fields.slug} rel="next" className="group block">
154154
<div className="bg-card hover:bg-card/80 border rounded-lg p-6 transition-colors duration-200">
155155
<div className="flex items-start space-x-3">
156156
<div className="flex-1 min-w-0 text-right">
157157
<p className="text-sm text-muted-foreground mb-1">
158158
다음 포스트
159159
</p>
160160
<h3 className="font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2">
161-
{previous.frontmatter.title}
161+
{next.frontmatter.title}
162162
</h3>
163163
</div>
164164
<div className="flex-shrink-0 p-2 bg-muted rounded-full group-hover:bg-muted/80 transition-colors">

0 commit comments

Comments
 (0)