Kleinere Anpassungen für Seiten- und Navigations- Bearbeitung.

This commit is contained in:
2022-05-30 15:57:11 +02:00
parent c67f712280
commit 5d08a96327
11 changed files with 32 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { Router, Route } from "svelte-routing"
import { scrollToTop } from "svelte-scrollto"
import { generalInfo, location } from "../store"
import { generalInfo, location, currentLang } from "../store"
import Home from "./routes/Home.svelte"
import Content from "./routes/Content.svelte"
@@ -64,7 +64,7 @@
<Home />
</Route>
<Route path="/*path" let:params>
<Content path="/{params.path}" />
<Content path="{params.path}" />
</Route>
</Router>

View File

@@ -31,7 +31,7 @@
<svelte:head>
<title>{content?.name ? content?.name + " - " : ""}{$generalInfo?.meta?.metaTitle}</title>
</svelte:head>
{path}
<div class="container">
<div class="row">
<div class="col-md-12">
@@ -45,6 +45,8 @@
<div class="page-404">
<div>
<Image
collectionName="general"
entryId="{$generalInfo.id}"
file="{$generalInfo?.media?.brand}"
alt="{$generalInfo?.meta?.metaTitle}"
cssClass="brand"

View File

@@ -14,13 +14,9 @@
}
const setLanguage = (lang: string) => {
let path = $location.path.split("/")
path[1] = lang
$location.path = path.join("/")
$currentLang = lang
navigate($location.path + $location.search, { replace: true })
// $location.path = "/" + lang
// navigate($location.path + $location.search, { replace: true })
}
</script>

View File

@@ -4,7 +4,7 @@
import { mdiMenu } from "@mdi/js"
import { links } from "svelte-routing"
import { navigations, currentLang } from "../../store"
import { navigations, currentLang, location } from "../../store"
import LanguageChooser from "./LanguageChooser.svelte"
@@ -40,7 +40,7 @@
{item.settings.title}
</a>
{:else}
<a href="/{navigation.locale}{item.settings.page}">
<a href="{item.settings.page}" class:active="{item.settings.page === $location.path}">
{item.settings.title}
</a>
{/if}
@@ -69,7 +69,11 @@
</div>
{:else}
<div class="nav-item">
<a href="/{navigation.locale}{item.settings.page}" on:click="{() => (showMobileNav = false)}">
<a
href="{item.settings.page}"
on:click="{() => (showMobileNav = false)}"
class:active="{item.settings.page === $location.path}"
>
{item.settings.title}
</a>
</div>