Use SvelteKit render function for templating and add error page

This commit is contained in:
thiloho
2024-08-17 19:29:10 +02:00
parent e41b963666
commit f3278fb1f6
11 changed files with 141 additions and 154 deletions

View File

@@ -0,0 +1,42 @@
<script lang="ts">
const { title, logoType, logo, mainContent, coverImage, publicationDate, footerAdditionalText } =
$props<{
title: string;
logoType: "text" | "image";
logo: string;
mainContent: string;
coverImage: string;
publicationDate: string;
footerAdditionalText: string;
}>();
</script>
<svelte:head>
<head>
<title>{title}</title>
</head>
</svelte:head>
<nav>
{#if logoType === "text"}
<p>
<strong>{logo}</strong>
</p>
{:else}
<img src={logo} alt="" />
{/if}
</nav>
<header>
<img src={coverImage} alt="" />
<h1>{title}</h1>
<p>{publicationDate}</p>
</header>
<main>
{@html mainContent}
</main>
<footer>
{footerAdditionalText}
</footer>