Skip to content

Commit

Permalink
fix: set correct basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
DerStimmler committed Aug 26, 2023
1 parent 71b8f61 commit f09f251
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
retention-days: 30

deploy-demo:
name: Deploy demo
name: Deploy app
runs-on: ubuntu-latest
needs: build
permissions:
Expand Down
3 changes: 2 additions & 1 deletion src/routes/+error.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { goto } from '$app/navigation';
import { base } from '$app/paths';
goto('/');
goto(`${base}/`);
</script>
3 changes: 2 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import '../app.css';
import { base } from '$app/paths';
</script>

<header class="flex flex-col gap-2">
Expand All @@ -15,7 +16,7 @@

<footer class="w-full flex justify-between items-center">
<a href="https://github.com/derstimmler/stromgedacht-web">
<img src="images/github-mark-white.svg" width="32" height="32" alt="github logo" />
<img src="{base}/images/github-mark-white.svg" width="32" height="32" alt="github logo" />
</a>
<a href="https://stromgedacht.de" target="_blank">StromGedacht</a>
</footer>
8 changes: 7 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';

const isProduction = process.env.NODE_ENV === 'production';

/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
Expand All @@ -16,7 +18,11 @@ const config = {
fallback: undefined,
precompress: false,
strict: true
})
}),
paths: {
base: isProduction ? '/stromgedacht-web' : '',
relative: true
}
}
};

Expand Down

0 comments on commit f09f251

Please sign in to comment.