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:
parent
85c06ef25e
commit
86a7673e1e
1 changed files with 17 additions and 0 deletions
17
src/App.tsx
17
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({}, "", "/");
|
||||
|
|
|
|||
Loading…
Reference in a new issue