Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
send_page_view: false
});
</script>

<script>
var path = window.location.pathname;
if (!path.startsWith("/#") && !['/', ''].includes(path)) {
window.location.replace(`/#${path}`);
}
</script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Route, Routes } from "react-router-dom";
import { usePageTracking } from "./hooks/usePageTracking";
import Home from "./pages/Home";
import Team from "./pages/Team";
import Sponsors from "./pages/Sponsors";

function App() {
usePageTracking();
Expand All @@ -10,6 +11,7 @@ function App() {
<Routes>
<Route path="/" element={<Home />} />
<Route path="/team" element={<Team />} />
<Route path="/sponsors" element={<Sponsors />} />
</Routes>
);
}
Expand Down
8 changes: 5 additions & 3 deletions src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { HashRouter } from "react-router-dom";
import "./index.css";
import App from "./App.jsx";

const baseUrl = (import.meta.env.BASE_URL ?? "/").replace(/\/$/, "") || undefined;

createRoot(document.getElementById("root")).render(
<StrictMode>
<BrowserRouter>
<HashRouter basename={baseUrl}>
<App />
</BrowserRouter>
</HashRouter>
</StrictMode>,
);
7 changes: 7 additions & 0 deletions src/pages/Sponsors/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Sponsors = () => {
return (
<div>Sponsors</div>
)
}

export default Sponsors
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: "/",
});
Loading