Skip to content

Commit 480602d

Browse files
committed
Merge branch 'dev' into blog
1 parent 127a290 commit 480602d

File tree

5 files changed

+519
-603
lines changed

5 files changed

+519
-603
lines changed

app/(blog)/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export default function BlogLayout({
88
}) {
99
return (
1010
<>
11-
<LeftSidebar className="w-48 xl:w-52 2xl:w-56 lg:shrink-0 lg:sticky h-full lg:top-40 mb-4 lg:mb-0 mt-40" />
11+
<LeftSidebar className="w-48 xl:w-52 2xl:w-56 lg:shrink-0 lg:sticky h-full lg:top-16 mb-4 lg:mb-0 mt-52" />
1212
<div className="xl:max-w-5xl mx-auto rounded-lg w-full overflow-x-hidden p-3 2xl:p-6 h-full">
1313
{children}
1414
</div>
15-
<RightSidebar className="w-48 xl:w-52 2xl:w-56 shrink-0 hidden xl:block sticky top-40 h-full mt-40" />
15+
<RightSidebar className="w-48 xl:w-52 2xl:w-56 shrink-0 hidden xl:block sticky top-16 h-full mt-52" />
1616
</>
1717
);
1818
}

app/(blog)/posts/[...slug]/page.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import MarkdownRenderer from "@/components/markdown-renderer";
21
import Link from "next/link";
3-
import { getPost, getPosts } from "@/lib/posts";
2+
import { getPost, getPosts, getAdjacentPosts } from "@/lib/posts";
43
import { ArrowLeft } from "lucide-react";
4+
import PostAnimation from "@/components/post-animation";
5+
import PostContent from "./post-content";
56

67
interface PostPageProps {
78
params: Promise<{ slug: string[] }>;
@@ -25,7 +26,7 @@ export default async function PostPage({ params }: PostPageProps) {
2526

2627
if (!post) {
2728
return (
28-
<article className="rounded-lg p-0 xl:lp-8 min-h-[70vh]">
29+
<article className="rounded-lg p-2 sm:p-7 max-w-3xl mx-auto">
2930
<h1 className="text-xl sm:text-2xl font-bold mb-4 sm:mb-6">
3031
포스트를 찾을 수 없습니다.
3132
</h1>
@@ -42,29 +43,20 @@ export default async function PostPage({ params }: PostPageProps) {
4243

4344
const publishPath = post.urlPath.split("/").slice(0, -1).join("/");
4445

45-
return (
46-
<article className="rounded-lg p-2 sm:p-7 max-w-3xl mx-auto">
47-
{/* 마크다운 콘텐츠 */}
48-
<div className="min-h-[250px] sm:min-h-[300px]">
49-
<MarkdownRenderer
50-
content={post.content}
51-
publish={publishPath}
52-
published={post.createdAt}
53-
modified={post.modifiedAt}
54-
tags={post.tags}
55-
/>
56-
</div>
46+
// 이전/다음 게시물 가져오기
47+
const { prev, next } = await getAdjacentPosts(post);
5748

58-
{/* 홈으로 돌아가기 */}
59-
<div className="mt-8 sm:mt-10 md:mt-12 pt-4 sm:pt-6 border-t">
60-
<Link
61-
href="/"
62-
className="text-primary hover:underline inline-flex items-center text-sm sm:text-base"
63-
>
64-
<ArrowLeft className="mr-1 sm:mr-2 h-3 w-3 sm:h-4 sm:w-4" />
65-
홈으로 돌아가기
66-
</Link>
67-
</div>
68-
</article>
49+
return (
50+
<PostAnimation>
51+
<PostContent
52+
content={post.content}
53+
publishPath={publishPath}
54+
published={post.createdAt}
55+
modified={post.modifiedAt}
56+
tags={post.tags}
57+
prevPost={prev}
58+
nextPost={next}
59+
/>
60+
</PostAnimation>
6961
);
7062
}

0 commit comments

Comments
 (0)