Skip to content

Commit 193f8b7

Browse files
committed
style: add tags view to post page
1 parent 9727fb7 commit 193f8b7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pages/post/[id].tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ export default function Post({ postData, relatedPosts }: InferGetStaticPropsType
100100
<main className="flex-1 prose prose-xl max-w-none">
101101
<h1 className="text-4xl font-bold mb-4">{postData.title}</h1>
102102
<p className="text-gray-500 text-sm mb-8">{postData.date}</p>
103+
{postData.tags && (
104+
<div className="flex flex-wrap gap-2 mb-8">
105+
{postData.tags.map((tag) => (
106+
<span
107+
key={tag}
108+
className="px-2 py-1 text-mi font-medium bg-blue-50 text-blue-700 rounded-md dark:bg-blue-900 dark:text-blue-200"
109+
>
110+
#{tag}
111+
</span>
112+
))}
113+
</div>
114+
)}
103115
<article className="overflow-x-auto">
104116
<MDXRemote {...postData.mdxSource} components={components}/>
105117
</article>

0 commit comments

Comments
 (0)