Fix base path

This commit is contained in:
Sidharth Vinod
2021-05-23 00:14:12 +05:30
parent a0e12c708a
commit 18dc0943b0
2 changed files with 9 additions and 8 deletions
+6 -5
View File
@@ -1,15 +1,16 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
// Handle old live editor links and redirect to new version
import { base } from '$app/paths';
onMount(async () => {
// Handle old live editor links and redirect to new version
const hash = window.location.hash.split('/');
let newURL = '/edit';
let newURL = 'edit';
if (hash.length > 2) {
newURL = `/${hash[1]}#${hash[2]}`;
newURL = `${hash[1]}#${hash[2]}`;
}
debugger;
await goto(newURL, {
await goto(`${base}/${newURL}`, {
replaceState: true
});
});
+3 -3
View File
@@ -15,9 +15,9 @@ const config = {
adapter: adapter({
pages: 'docs'
}),
// paths: {
// base: '/mermaid-svelte-kit'
// },
paths: {
base: '/mermaid-svelte-kit'
},
ssr: false,
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte'