mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Add ability to export articles, track publications in json file on NGINX, fix vulnerabilities and refactor
This commit is contained in:
64
web-app/src/lib/templates/Article.svelte
Normal file
64
web-app/src/lib/templates/Article.svelte
Normal file
@@ -0,0 +1,64 @@
|
||||
<script lang="ts">
|
||||
import { md, type WebsiteOverview } from "$lib/utils";
|
||||
import type { Article } from "$lib/db-schema";
|
||||
import Head from "$lib/templates/Head.svelte";
|
||||
import Nav from "$lib/templates/Nav.svelte";
|
||||
import Footer from "$lib/templates/Footer.svelte";
|
||||
|
||||
const {
|
||||
websiteOverview,
|
||||
article,
|
||||
apiUrl,
|
||||
websiteUrl
|
||||
}: {
|
||||
websiteOverview: WebsiteOverview;
|
||||
article: Article;
|
||||
apiUrl: string;
|
||||
websiteUrl: string;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<Head
|
||||
{websiteOverview}
|
||||
nestingLevel={1}
|
||||
{apiUrl}
|
||||
title={article.title}
|
||||
slug={article.slug as string}
|
||||
metaDescription={article.meta_description}
|
||||
{websiteUrl}
|
||||
/>
|
||||
|
||||
<Nav
|
||||
{websiteOverview}
|
||||
isDocsTemplate={websiteOverview.content_type === "Docs"}
|
||||
isIndexPage={false}
|
||||
{apiUrl}
|
||||
/>
|
||||
|
||||
<header>
|
||||
<div class="container">
|
||||
{#if websiteOverview.content_type === "Blog"}
|
||||
<hgroup>
|
||||
{#if article.publication_date}
|
||||
<p>{article.publication_date}</p>
|
||||
{/if}
|
||||
<h1>{article.title}</h1>
|
||||
</hgroup>
|
||||
{#if article.cover_image}
|
||||
<img src="{apiUrl}/rpc/retrieve_file?id={article.cover_image}" alt="" />
|
||||
{/if}
|
||||
{:else}
|
||||
<h1>{article.title}</h1>
|
||||
{/if}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{#if article.main_content}
|
||||
<main>
|
||||
<div class="container">
|
||||
{@html md(article.main_content)}
|
||||
</div>
|
||||
</main>
|
||||
{/if}
|
||||
|
||||
<Footer {websiteOverview} />
|
||||
Reference in New Issue
Block a user