File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments