From cbf104c02d448e809f067df70b92a17394c38f28 Mon Sep 17 00:00:00 2001
From: schererleander <leander@schererleander.de>
Date: Sat, 4 Oct 2025 03:11:02 +0200
Subject: fix: call useEffect unconditionally to satisfy hooks rules

---
 src/pages/Post.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/pages/Post.tsx')

diff --git a/src/pages/Post.tsx b/src/pages/Post.tsx
index b4e7151..83a4c20 100644
--- a/src/pages/Post.tsx
+++ b/src/pages/Post.tsx
@@ -20,18 +20,20 @@ export default function Post() {
 	const { slug } = useParams();
 
 	const post = posts[`../blog/${slug}.md`];
+	const title = post?.attributes.title ?? "߸ blog post"
+
+	useEffect(() => {
+		document.title = `߸ ${meta.title}`;
+	}, [title])
 
 	if (!post) return <Navigate to="/404" replace />;
 
 	const { attributes: meta, ReactComponent: Content } = post;
 
-	useEffect(() => {
-		document.title = `߸ ${meta.title}`;
-	}, [meta.title])
+
 
 	return (
 		<>
-			<title>߸ blog post</title>
 			<main>
 				<a href="/blog" className="no-underline hover:underline">
 					← Back
-- 
cgit v1.3.1

