Skip to content

Commit 8e740dd

Browse files
author
Sebastian Flick
committed
add base to links
1 parent c8a7024 commit 8e740dd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/lib/components/VerseSelector.svelte

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script>
22
import { goto, preloadData } from '$app/navigation';
3+
import { base } from '$app/paths';
34
45
export let targetPath = '/einzelverssynopse';
56
@@ -44,7 +45,9 @@
4445
class="flex max-w-full items-baseline gap-1 my-3"
4546
on:submit|preventDefault={(e) => {
4647
if (validateMinMax(thirties) && validateMinMax(verse)) {
47-
goto(`${targetPath}/${thirties.value}/${verse.value}${additional ? '-' + additional : ''}`);
48+
goto(
49+
`${base}${targetPath}/${thirties.value}/${verse.value}${additional ? '-' + additional : ''}`
50+
);
4851
}
4952
}}
5053
>

src/routes/einzelverssynopse/[thirties]/[verse]/+page.svelte

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { SlideToggle } from '@skeletonlabs/skeleton';
44
import VerseSelector from '$lib/components/VerseSelector.svelte';
55
import { afterNavigate } from '$app/navigation';
6+
import { base } from '$app/paths';
67
78
/** @type {import('./$types').PageData} */
89
export let data;
@@ -113,7 +114,7 @@
113114
{#if !(parseInt(thirties) === 1 && parseInt(verse) === 1)}
114115
<a
115116
class="anchor"
116-
href="/einzelverssynopse/{parseInt(verse) === 1
117+
href="{base}einzelverssynopse/{parseInt(verse) === 1
117118
? parseInt(thirties) - 1
118119
: thirties}/{parseInt(verse) === 1 ? 30 : parseInt(verse) - 1}"
119120
>
@@ -123,7 +124,7 @@
123124
{#if !(parseInt(thirties) === 827 && parseInt(verse) === 30)}
124125
<a
125126
class="anchor"
126-
href="/einzelverssynopse/{parseInt(verse) === 30
127+
href="{base}einzelverssynopse/{parseInt(verse) === 30
127128
? parseInt(thirties) + 1
128129
: thirties}/{parseInt(verse) === 30 ? 1 : parseInt(verse) + 1}"
129130
>

0 commit comments

Comments
 (0)