From d7a0a24a8f80cc50d0cd8b71822cec28fdf319bb Mon Sep 17 00:00:00 2001 From: Alexander Daichendt Date: Tue, 26 Jul 2022 22:50:17 +0200 Subject: [PATCH] fix: wrong seo data --- src/app.d.ts | 6 +++++- src/routes/__layout.svelte | 15 ++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app.d.ts b/src/app.d.ts index b28d840..4abaddc 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -7,5 +7,9 @@ declare namespace App { // interface Locals {} // interface Platform {} // interface Session {} - // interface Stuff {} + interface Stuff { + title?: string; + description?: string; + keywords?: string[]; + } } diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index f8402f4..a0ff89f 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -16,16 +16,21 @@ { href: '/blog', label: 'Blog' }, { href: '/contact', label: 'Contact' }, ]; + $: wrappedTitle = $page.stuff.title + ? `${$page.stuff.title} - Alex Daichendt` + : "Alex Daichendt's website"; + $: description = $page.stuff.description; + $: keywords = $page.stuff.keywords; {$page.stuff.title} - AlexDaichendt - {#if $page.stuff.description} - + >{wrappedTitle} + {#if description} + {/if} - {#if $page.stuff.keywords} - + {#if keywords} + {/if}