{post.title}
@@ -49,7 +50,7 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str {post.coverImage && (
{post.tags.map((tag) => (
-
+
{tag}
-
+
))}
)}
diff --git a/components/blog/PostCard.tsx b/components/blog/PostCard.tsx
index 4c15971..21eab35 100644
--- a/components/blog/PostCard.tsx
+++ b/components/blog/PostCard.tsx
@@ -4,6 +4,18 @@ import Link from 'next/link';
import { m } from 'motion/react';
import type { PostMeta } from '@/lib/posts';
+const tagToClientSlug = (tag: string): string =>
+ tag
+ .normalize('NFKD')
+ .toLowerCase()
+ .replace(/[\u0300-\u036f]/g, '')
+ .replace(/\+/g, ' plus ')
+ .replace(/#/g, ' sharp ')
+ .replace(/[\\/]+/g, ' ')
+ .replace(/[^\p{L}\p{N}]+/gu, '-')
+ .replace(/-{2,}/g, '-')
+ .replace(/^-|-$/g, '');
+
export function PostCard({ slug, title, date, excerpt, tags = [], author, readingTime, index = 0, coverImage }: PostMeta & { index?: number }) {
return (