From 86a7673e1e5569924a2abdd94e21f342afe8e3f1 Mon Sep 17 00:00:00 2001 From: Dada1981 Date: Sun, 19 Jul 2026 23:55:41 +0200 Subject: [PATCH] feat: dynamic browser tab titles Update document title based on the active route and author persona for better SEO and user context. --- src/App.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 7ed6e4d..6394255 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -38,6 +38,23 @@ export default function App() { }); }, []); + // Dynamisch den Dokumententitel (Browsertab-Titel) basierend auf Pfad und Autorendaten anpassen + useEffect(() => { + if (!authorData) { + document.title = "Lade Autoren-Portfolio..."; + return; + } + if (currentPath === "/admin" || currentPath.startsWith("/admin/")) { + document.title = "Admin-Zentrale | Autor-Suiten"; + } else if (currentPath === "/sensual-moments" || currentPath.startsWith("/sensual-moments/")) { + document.title = authorData.erotica.name || "Marc Velvet"; + } else if (currentPath === "/clara-finch" || currentPath.startsWith("/clara-finch/")) { + document.title = authorData.clara.name || "Clara Finch"; + } else { + document.title = authorData.scifi.name || "Daniel Hesse"; + } + }, [currentPath, authorData]); + const handleAdminLogout = () => { // Relocate to landing site after administration work window.history.pushState({}, "", "/");