Skip to content

Commit ac057e1

Browse files
committed
fix 2
1 parent 3bb80ce commit ac057e1

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.github/workflows/static.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches: [main] # or 'master' depending on your repo
5+
branches: [main]
66

77
permissions:
88
contents: write
99

1010
jobs:
1111
build_and_deploy:
1212
runs-on: ubuntu-latest
13-
14-
defaults:
15-
run:
16-
working-directory: htmltoolkit
17-
1813
steps:
1914
- name: Checkout repo
2015
uses: actions/checkout@v4
@@ -25,13 +20,19 @@ jobs:
2520
node-version: 20
2621

2722
- name: Install dependencies
28-
run: npm ci
23+
run: cd htmltoolkit && npm ci
2924

3025
- name: Build the site
31-
run: npm run build
26+
run: cd htmltoolkit && npm run build
27+
28+
- name: Rename 200.html to 404.html for GitHub Pages SPA fallback
29+
run: |
30+
if [ -f htmltoolkit/build/200.html ]; then
31+
mv htmltoolkit/build/200.html htmltoolkit/build/404.html
32+
fi
3233
3334
- name: Deploy to GitHub Pages
3435
uses: JamesIves/github-pages-deploy-action@v4
3536
with:
36-
branch: gh-pages # Target branch
37-
folder: htmltoolkit/build # Path from root to built site
37+
branch: gh-pages
38+
folder: htmltoolkit/build

htmltoolkit/svelte.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const config = {
1818
],
1919

2020
kit: {
21-
adapter: adapter(),
21+
adapter: adapter({
22+
fallback: '200.html' // Add fallback here
23+
}),
2224
paths: {
2325
base: dev ? '' : '/htmltoolkit.github.io',
2426
},

0 commit comments

Comments
 (0)