fix: wrong seo data

This commit is contained in:
Alexander Daichendt 2022-07-26 22:50:17 +02:00
parent fb484c614d
commit d7a0a24a8f
2 changed files with 15 additions and 6 deletions

6
src/app.d.ts vendored
View file

@ -7,5 +7,9 @@ declare namespace App {
// interface Locals {} // interface Locals {}
// interface Platform {} // interface Platform {}
// interface Session {} // interface Session {}
// interface Stuff {} interface Stuff {
title?: string;
description?: string;
keywords?: string[];
}
} }

View file

@ -16,16 +16,21 @@
{ href: '/blog', label: 'Blog' }, { href: '/blog', label: 'Blog' },
{ href: '/contact', label: 'Contact' }, { 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;
</script> </script>
<svelte:head <svelte:head
><title>{$page.stuff.title} - AlexDaichendt</title> ><title>{wrappedTitle}</title>
{#if $page.stuff.description} {#if description}
<meta name="description" content={$page.stuff.description} /> <meta name="description" content={description} />
{/if} {/if}
<meta name="author" content="Alexander Daichendt" /> <meta name="author" content="Alexander Daichendt" />
{#if $page.stuff.keywords} {#if keywords}
<meta name="keywords" content={$page.stuff.keywords.join(',')} /> <meta name="keywords" content={keywords.join(',')} />
{/if} {/if}
</svelte:head> </svelte:head>