feat: dynamic browser tab titles

Update document title based on the active route and author persona for better SEO and user context.
This commit is contained in:
Dada1981 2026-07-19 23:55:41 +02:00
parent 85c06ef25e
commit 86a7673e1e

View file

@ -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 = () => { const handleAdminLogout = () => {
// Relocate to landing site after administration work // Relocate to landing site after administration work
window.history.pushState({}, "", "/"); window.history.pushState({}, "", "/");