forked from cms/tibi-svelte-starter
Starter Projekt angefangen, etwas aufzubohren und ein paar grundlegend benötigte Collections, Teheming-Styles und Komponenten hinzugefügt. (WIP)
This commit is contained in:
@@ -1,7 +1,49 @@
|
||||
<script lang="ts">
|
||||
import { getContent } from "../../api"
|
||||
// import { apiBaseURL } from "../../config"
|
||||
import { generalInfo } from "../../store"
|
||||
|
||||
export let path: string
|
||||
|
||||
console.log("Content: ", path)
|
||||
let loading = true
|
||||
let content: Content
|
||||
|
||||
function load() {
|
||||
loading = true
|
||||
getContent(path)
|
||||
.then((c) => {
|
||||
content = c
|
||||
})
|
||||
.finally(() => {
|
||||
loading = false
|
||||
})
|
||||
}
|
||||
|
||||
$: if (path) load()
|
||||
</script>
|
||||
|
||||
<h2>{path}</h2>
|
||||
<svelte:head>
|
||||
<title>{content?.name ? content?.name + " - " : ""}{$generalInfo?.meta?.metaTitle}</title>
|
||||
<meta name="description" content="{$generalInfo?.meta?.metaDescription}" />
|
||||
<meta name="keywords" content="{$generalInfo?.meta?.metaKeywords.replaceAll(' ', '')}" />
|
||||
<meta name="author" content="{$generalInfo?.person?.firstname} {$generalInfo?.person?.lastname}" />
|
||||
<meta name="robots" content="{$generalInfo?.meta?.metaTagRobots}" />
|
||||
</svelte:head>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{#if loading}
|
||||
<!-- Loader -->
|
||||
{:else if content}
|
||||
{#each content.blocks || [] as b}
|
||||
<h2>{b.title}</h2>
|
||||
<div>{@html b.text}</div>
|
||||
{/each}
|
||||
{:else}
|
||||
<h1>Seite nicht gefunden</h1>
|
||||
<div>Pfad: {path}</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user