Files
archtika/web-app/src/lib/templates/blog/BlogArticle.svelte

46 lines
1.1 KiB
Svelte
Raw Normal View History

<script lang="ts">
2024-08-27 16:39:29 +02:00
import Head from "../common/Head.svelte";
import Nav from "../common/Nav.svelte";
import Footer from "../common/Footer.svelte";
import { type WebsiteOverview, md } from "../../utils";
import type { Article } from "../../db-schema";
2024-08-20 19:17:05 +02:00
const {
websiteOverview,
article,
apiUrl
}: { websiteOverview: WebsiteOverview; article: Article; apiUrl: string } = $props();
</script>
<Head
{websiteOverview}
nestingLevel={1}
{apiUrl}
title={article.title}
metaDescription={article.meta_description}
/>
<Nav {websiteOverview} isDocsTemplate={false} isIndexPage={false} {apiUrl} />
<header>
2024-08-18 19:18:32 +02:00
<div class="container">
2024-08-18 20:12:27 +02:00
<hgroup>
<p>{article.publication_date}</p>
<h1>{article.title}</h1>
2024-08-18 20:12:27 +02:00
</hgroup>
{#if article.cover_image}
<img src="{apiUrl}/rpc/retrieve_file?id={article.cover_image}" alt="" />
2024-08-18 19:18:32 +02:00
{/if}
</div>
</header>
{#if article.main_content}
2024-08-20 19:17:05 +02:00
<main>
<div class="container">
{@html md(article.main_content)}
2024-08-20 19:17:05 +02:00
</div>
</main>
{/if}
<Footer {websiteOverview} isIndexPage={false} />