Skip to content

Commit 30b8d32

Browse files
committed
fix: pathing for gh pages
1 parent bbbfe08 commit 30b8d32

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/gh-pages.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ jobs:
4242

4343
- name: Build sveltekit project
4444
shell: bash
45+
env:
46+
BASE_PATH: '/${{ github.event.repository.name }}'
4547
run: npm ci && npm run build
4648

4749
- name: Upload artifact
4850
uses: actions/upload-pages-artifact@v3
4951
with:
50-
# Upload entire repository
51-
path: './build'
52+
# Upload the build directory
53+
path: 'build/'
5254

5355
- name: Deploy to GitHub Pages
5456
id: deployment

src/routes/+layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export const prerender = true;
2-
// export const trailingSlash = 'always';
2+
export const trailingSlash = 'always';

svelte.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const config = {
2121
alias: {
2222
'@/*': './src/lib/*',
2323
},
24+
paths: {
25+
base: process.argv.includes('dev') ? '' : process.env.BASE_PATH
26+
},
2427
}
2528
};
2629

0 commit comments

Comments
 (0)