Typ Select für Artikel hinzugefügt. Artikel-Details Komponenten sind nun für jeden Typ verfügbar, wenn benötigt.

This commit is contained in:
2022-06-15 13:06:43 +02:00
parent 652f15830d
commit 0d06a61c7f
9 changed files with 106 additions and 38 deletions

View File

@@ -6,10 +6,9 @@
import Image from "../widgets/Image.svelte"
import ArticlesList from "../widgets/ArticlesList.svelte"
import Article from "../widgets/Article.svelte"
import ArticleDetails from "../routes/ArticleDetails.svelte"
export let path: string
let oldPath: string = null
let loading = true
let content: Content
@@ -63,8 +62,6 @@
content = null
}
oldPath = path
// Redirect to HOME if no content has been found. So the page 404 content will never shown.
if (!content) {
navigate("/")
@@ -103,7 +100,6 @@
getArticles("articles", apiParams)
.then((respoonse) => {
article = respoonse[0]
oldPath = path
})
.finally(() => {
loading = false
@@ -166,7 +162,7 @@
{#if loading}
<!-- Loader -->
{:else if article}
<Article entry="{article}" showDetails />
<ArticleDetails entry="{article}" />
{:else if content}
<ArticlesList path="{path}" tags="{content?.tags}" />
{:else}