web: add dynamic page titles

This commit is contained in:
wukko
2024-06-25 21:01:08 +06:00
parent 7b289bfb16
commit 635561394c
5 changed files with 30 additions and 0 deletions

View File

@@ -15,11 +15,19 @@
let screenWidth: number;
$: currentPageTitle = $page.url.pathname.split("/").at(-1);
$: stringPageTitle =
currentPageTitle !== "settings" ? `/ ${currentPageTitle}` : "";
$: isMobile = screenWidth <= 750;
$: isHome = $page.url.pathname === `/settings`;
</script>
<svelte:head>
<title>
cobalt: settings {stringPageTitle}
</title>
</svelte:head>
<svelte:window bind:innerWidth={screenWidth} />
<div id="settings-page">