Tidy dynamic title handling
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
]
|
||||
|
||||
const activePath = $derived(page.url?.pathname ?? '');
|
||||
const isHome = $derived(page.url?.pathname ?? '' === '/');
|
||||
const isHome = $derived(page.url.pathname === '/');
|
||||
|
||||
|
||||
const moreIcon = IconDots;
|
||||
@@ -36,7 +36,7 @@
|
||||
{/if}
|
||||
</a>
|
||||
{#if !isHome}
|
||||
<h1 class="page-title">{headerState?.title ?? ""}</h1>
|
||||
<h1 class="page-title">{page?.data?.title ?? ""}</h1>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
<script lang="ts">
|
||||
import headerState from '$lib/Header/Header.svelte.ts'
|
||||
headerState.title = "About"
|
||||
</script>
|
||||
5
src/routes/about/+page.ts
Normal file
5
src/routes/about/+page.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const load = () => {
|
||||
return {
|
||||
title: "About",
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user