Skip to content

Commit

Permalink
Fix base path
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed May 22, 2021
1 parent a0e12c7 commit 18dc094
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/routes/index.svelte
Original file line number Diff line number Diff line change
@@ -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
});
});
Expand Down
6 changes: 3 additions & 3 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 18dc094

Please sign in to comment.