Skip to content

Commit

Permalink
try to fix base
Browse files Browse the repository at this point in the history
  • Loading branch information
mishankov committed Mar 6, 2024
1 parent fb1c930 commit a819285
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
cache: 'npm'

- run: npm ci
- run: npm run build:ghp --if-present
- run: npm run build --if-present

- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "vite dev",
"build": "vite build",
"build:ghp": "vite build --base=/string-manipulator/",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/Link.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script lang="ts">
import { base } from '$app/paths';
export let link: string;
</script>

<a href={link}><slot /></a>
<a href="{base}/{link}"><slot /></a>

<style>
a {
Expand Down
5 changes: 4 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
adapter: adapter(),
paths: {
base: process.env.NODE_ENV === 'production' ? '/string-manipulator' : ''
}
}
};

Expand Down

0 comments on commit a819285

Please sign in to comment.