Tidy dynamic title handling
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
]
|
]
|
||||||
|
|
||||||
const activePath = $derived(page.url?.pathname ?? '');
|
const activePath = $derived(page.url?.pathname ?? '');
|
||||||
const isHome = $derived(page.url?.pathname ?? '' === '/');
|
const isHome = $derived(page.url.pathname === '/');
|
||||||
|
|
||||||
|
|
||||||
const moreIcon = IconDots;
|
const moreIcon = IconDots;
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
{#if !isHome}
|
{#if !isHome}
|
||||||
<h1 class="page-title">{headerState?.title ?? ""}</h1>
|
<h1 class="page-title">{page?.data?.title ?? ""}</h1>
|
||||||
{/if}
|
{/if}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import headerState from '$lib/Header/Header.svelte.ts'
|
|
||||||
headerState.title = "About"
|
|
||||||
</script>
|
</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