Fix base path
This commit is contained in:
@@ -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
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user