File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
77 < title > pecan-live-dashboard</ title >
8+ < script >
9+ // GitHub Pages SPA redirect workaround - restore URL from 404.html
10+ ( function ( ) {
11+ var redirect = sessionStorage . redirect ;
12+ delete sessionStorage . redirect ;
13+ if ( redirect && redirect !== location . href ) {
14+ history . replaceState ( null , null , redirect ) ;
15+ }
16+ } ) ( ) ;
17+ </ script >
818 </ head >
919 < body >
1020 < div id ="root "> </ div >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < title > Redirecting...</ title >
6+ < script >
7+ // GitHub Pages SPA redirect workaround
8+ // Store the path and redirect to index.html
9+ sessionStorage . redirect = location . href ;
10+ </ script >
11+ < meta http-equiv ="refresh " content ="0;URL='/' ">
12+ </ head >
13+ < body >
14+ </ body >
15+ </ html >
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import Settings from "./pages/Settings";
77import ChargeCart from "./pages/ChargeCart" ;
88import MonitorBuilder from "./pages/MonitorBuilder" ;
99
10+ // Get base path for GitHub Pages deployment
11+ const basename = import . meta. env . BASE_URL || '/' ;
12+
1013export const router = createBrowserRouter ( [
1114 {
1215 path : "/" ,
@@ -21,4 +24,4 @@ export const router = createBrowserRouter([
2124 { path : "monitor-builder" , element : < MonitorBuilder /> } ,
2225 ] ,
2326 } ,
24- ] ) ;
27+ ] , { basename } ) ;
You can’t perform that action at this time.
0 commit comments