diff --git a/api/collections/fields/_article.yml b/api/collections/fields/_article.yml index 815a55b..84c7e36 100644 --- a/api/collections/fields/_article.yml +++ b/api/collections/fields/_article.yml @@ -98,7 +98,6 @@ subFields: label: de: Inhalt en: Content - css: subFields: - name: slug type: string diff --git a/src/components/App.svelte b/src/components/App.svelte index 48127b9..b7d9c6c 100644 --- a/src/components/App.svelte +++ b/src/components/App.svelte @@ -6,6 +6,7 @@ import Home from "./routes/Home.svelte" import Content from "./routes/Content.svelte" + import ArticleDetails from "./routes/ArticleDetails.svelte" import Header from "./widgets/Header.svelte" import Footer from "./widgets/Footer.svelte" @@ -65,7 +66,8 @@ - + + diff --git a/src/components/routes/ArticleDetails.svelte b/src/components/routes/ArticleDetails.svelte index 8f00a73..1428de5 100644 --- a/src/components/routes/ArticleDetails.svelte +++ b/src/components/routes/ArticleDetails.svelte @@ -2,15 +2,23 @@ import { currentLang } from "../../store" import { getArticles } from "../../api" - // import Article from "../widgets/Article.svelte" + import Article from "../widgets/Article.svelte" + + export let path: string + + let articleEntries: CollectionEntry[] = [] $: if ($currentLang) { + let urlParts = path.split("/") + let slug = urlParts[urlParts.length - 1] + getArticles("articles", { filter: { "article.general.locale": $currentLang, + "article.content.slug": slug, }, }).then((response) => { - console.log(response) + articleEntries = response }) } @@ -18,7 +26,9 @@
-

ARTICLE DETAILS

+ {#each articleEntries || [] as entry} +
+ {/each}