diff options
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/Post.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
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 |
