From 1bfa0d8b1b899973c944ba6913b4ac25bfbbe640 Mon Sep 17 00:00:00 2001 From: Mario Linz Date: Fri, 8 Jul 2022 14:44:23 +0200 Subject: [PATCH] =?UTF-8?q?Artikel=20rendern=20slug=20f=C3=BCr=20eventuell?= =?UTF-8?q?e=20Anker=20Links.=20Navigation=20vereinfacht=20und=20Item=20in?= =?UTF-8?q?=20eigene=20Komponente=20ausgelagert,=20um=20sp=C3=A4ter=20sch?= =?UTF-8?q?=C3=B6ner=20eine=20Multi-Level=20Navigation=20erstellen=20zu=20?= =?UTF-8?q?k=C3=B6nnen.=20Label=20in=20Navigation-Collection=20umbenannt.?= =?UTF-8?q?=20Home-Page=20Komponente=20vereinfacht.=20Content-Komponente?= =?UTF-8?q?=20f=C3=BCr=20eventuelles=20Animated-Ancher-Scrolling=20erweite?= =?UTF-8?q?rt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/collections/navigation.yml | 2 +- src/components/App.svelte | 29 ++++++- src/components/routes/Content.svelte | 21 ++++++ src/components/routes/Home.svelte | 48 +----------- src/components/widgets/Article.svelte | 5 +- src/components/widgets/Navigation.svelte | 75 ++----------------- src/components/widgets/NavigationItem.svelte | 63 ++++++++++++++++ src/css/theme-2022/components/article.less | 3 - src/css/theme-2022/components/navigation.less | 2 + 9 files changed, 127 insertions(+), 121 deletions(-) create mode 100644 src/components/widgets/NavigationItem.svelte diff --git a/api/collections/navigation.yml b/api/collections/navigation.yml index 60d1257..29654ed 100644 --- a/api/collections/navigation.yml +++ b/api/collections/navigation.yml @@ -144,7 +144,7 @@ x-url: &url defaultValue: "default" choices: - { id: "default", name: "Gleicher Tab oder Seite (ohne Refresh)" } - - { id: "_self", name: "Gleicher Tab oder Seite (Standardwert)" } + - { id: "_self", name: "Gleicher Tab oder Seite (mit Refresh)" } - { id: "_blank", name: "Neuer Tab oder Fenster" } - { id: "_parent", name: "Elternfenster" } diff --git a/src/components/App.svelte b/src/components/App.svelte index ab4867c..e82e53c 100644 --- a/src/components/App.svelte +++ b/src/components/App.svelte @@ -2,7 +2,7 @@ import { _ } from "svelte-i18n" import { Router, Route } from "svelte-routing" import { scrollToTop } from "svelte-scrollto" - import { location } from "../store" + import { location, generalInfo } from "../store" import Home from "./routes/Home.svelte" import Content from "./routes/Content.svelte" @@ -31,6 +31,33 @@ if (typeof window !== "undefined") console.log("App initialized") + + {#if $generalInfo?.meta?.metaTitle} + {$generalInfo?.meta?.metaTitle} + {/if} + {#if $generalInfo?.meta?.metaDescription} + + {/if} + {#if $generalInfo?.meta?.metaKeywords} + + {/if} + {#if $generalInfo?.person?.firstname || $generalInfo?.person?.lastname} + + {/if} + {#if $generalInfo?.meta?.metaTagRobots && $generalInfo?.meta?.metaTagRobots.length} + + {/if} + {#if $generalInfo?.media?.favicon} + + {/if} + +
diff --git a/src/components/routes/Content.svelte b/src/components/routes/Content.svelte index 3405df2..04bf213 100644 --- a/src/components/routes/Content.svelte +++ b/src/components/routes/Content.svelte @@ -1,4 +1,6 @@ diff --git a/src/components/routes/Home.svelte b/src/components/routes/Home.svelte index 983662c..b4257c1 100644 --- a/src/components/routes/Home.svelte +++ b/src/components/routes/Home.svelte @@ -1,44 +1,14 @@ - - {#if $generalInfo?.meta?.metaTitle} - {$generalInfo?.meta?.metaTitle} - {/if} - {#if $generalInfo?.meta?.metaDescription} - - {/if} - {#if $generalInfo?.meta?.metaKeywords} - - {/if} - {#if $generalInfo?.person?.firstname || $generalInfo?.person?.lastname} - - {/if} - {#if $generalInfo?.meta?.metaTagRobots && $generalInfo?.meta?.metaTagRobots.length} - - {/if} - {#if $generalInfo?.media?.favicon} - - {/if} - - @@ -46,17 +16,3 @@ - - diff --git a/src/components/widgets/Article.svelte b/src/components/widgets/Article.svelte index f0fe806..7a53d84 100644 --- a/src/components/widgets/Article.svelte +++ b/src/components/widgets/Article.svelte @@ -66,7 +66,10 @@ {#if article && published} -
+
{#if article?.layout?.variant === "top"} {#if article?.content?.types?.media?.files?.length} - import * as animateScroll from "svelte-scrollto" import Icon from "mdi-svelte" import { mdiMenu } from "@mdi/js" - import { links, link } from "svelte-routing" - import { navigations, currentLang, location } from "../../store" + import { navigations, currentLang } from "../../store" import LanguageChooser from "./LanguageChooser.svelte" + import NavigationItem from "./NavigationItem.svelte" export let ident = "main" @@ -26,36 +25,9 @@ {#if navigation} -