Skip to content

Commit cb0c1b0

Browse files
committed
playground woes
1 parent cd41c14 commit cb0c1b0

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/pages.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,12 @@ jobs:
7373
cp -r website/out/* _site/
7474
mkdir -p _site/playground
7575
cp -r playground/dist/* _site/playground/
76-
# SPA fallback for playground routes
77-
# GitHub Pages only checks root 404.html, so use a redirect
78-
cat > _site/404.html << 'FOUROHFOUR'
79-
<!DOCTYPE html><html><head><meta charset="utf-8"><script>
80-
var p = window.location.pathname;
81-
if (p.startsWith('/gnata-sqlite/playground')) {
82-
var base = '/gnata-sqlite/playground/';
83-
var route = p.slice(base.length);
84-
window.location.replace(base + '?route=' + encodeURIComponent(route) + window.location.hash);
85-
}
86-
</script></head><body></body></html>
87-
FOUROHFOUR
76+
# SPA fallback: copy index.html to each playground route
77+
# so GitHub Pages serves the app shell for direct navigation
78+
for route in sqlite gnata; do
79+
mkdir -p "_site/playground/${route}"
80+
cp playground/dist/index.html "_site/playground/${route}/index.html"
81+
done
8882
8983
- uses: actions/upload-pages-artifact@v3
9084

0 commit comments

Comments
 (0)