Skip to content

Commit c66cf81

Browse files
committed
feat: add post date and updated date in card views
1 parent 5c226dd commit c66cf81

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

lib/posts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const postsDirectory = path.join(process.cwd(), 'posts');
1414
type PostFrontmatter = {
1515
title: string;
1616
date: string;
17+
updated?: string;
1718
tags?: string[];
1819
summary?: string;
1920
description?: string;

pages/post.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ type Post = {
1111
summary?: string;
1212
description?: string;
1313
tags?: string[];
14+
date: string;
15+
updated?: string;
1416
};
1517

1618
type Props = {
@@ -125,24 +127,30 @@ export default function PostPage({ postsByTag, tagCounts }) {
125127
{/* 카드 리스트 영역 */}
126128
<div className="card-section max-w-6xl mx-auto px-4 pb-16 bg-white">
127129
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-8">
128-
{visiblePosts.map(({ id, title, summary, description }) => (
129-
<Link key={id} href={`/post/${id}`} legacyBehavior>
130-
<a className="group flex flex-col justify-between p-6 min-h-[200px] rounded-2xl border border-gray-200 bg-white shadow-sm hover:shadow-md hover:-translate-y-1 hover:bg-gray-50 transition duration-200 ease-in-out">
131-
<div className="space-y-2">
132-
<h2 className="text-xl font-extrabold leading-snug text-gray-900 group-hover:text-blue-600 transition">
133-
{title}
134-
</h2>
135-
{summary && <p className="text-blue-500 text-sm font-medium">{summary}</p>}
136-
<p className="text-sm text-gray-600 leading-relaxed line-clamp-3">{description}</p>
137-
</div>
138-
</a>
139-
</Link>
130+
{visiblePosts.map(({ id, title, summary, description, date, updated }) => (
131+
<Link key={id} href={`/post/${id}`} legacyBehavior>
132+
<a className="group flex flex-col justify-between p-6 min-h-[200px] rounded-2xl border border-gray-200 bg-white shadow-sm hover:shadow-md hover:-translate-y-1 hover:bg-gray-50 transition duration-200 ease-in-out">
133+
<div className="space-y-2">
134+
<h2 className="text-xl font-extrabold leading-snug text-gray-900 group-hover:text-blue-600 transition">
135+
{title}
136+
</h2>
137+
{summary && <p className="text-blue-500 text-sm font-medium">{summary}</p>}
138+
<p className="text-sm text-gray-600 leading-relaxed line-clamp-3">{description}</p>
139+
</div>
140+
<p className="text-xs text-gray-400 mt-4">
141+
Posted Date: {date}
142+
{updated && updated !== date && (
143+
<> ・ Updated: {updated}</>
144+
)}
145+
</p>
146+
</a>
147+
</Link>
140148
))}
141149
</div>
142150

143151
{/* 더 보기 버튼 */}
144152
{hasMore && (
145-
<div className="mt-10 text-center">
153+
<div className="mt-10 text-center">
146154
<button
147155
onClick={() => setVisibleCount(prev => prev + 10)}
148156
className="px-6 py-2 text-sm font-medium rounded-full bg-black text-white hover:bg-gray-800 transition"

posts/grpc/why-using-grpc.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "gRPC 를 도입하는 이유에 대해서 알아보자. (feat. Http 1.0 vs Http 1.1 vs Http 2.0)"
33
date: "2024-10-15"
4+
updated: "2025-06-30"
45
tags: ["gRPC, Study"]
56
summary: "Let's find out the issues with HTTP 1.0, HTTP 1.1, and the benefits of gRPC being introduced into the MSA structure."
67
description: "HTTP 1.0, HTTP 1.1 의 문제와 gRPC 가 MSA 구조에 도입되면 어떤 이점이 있는지 알아보자."

0 commit comments

Comments
 (0)