Skip to content

Commit 6b7aeeb

Browse files
fix: fix route not working
1 parent 6bb1aeb commit 6b7aeeb

5 files changed

Lines changed: 5 additions & 42 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "temp-project",
2+
"name": "frostpixel-portfolio",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

public/.nojekyll

Whitespace-only changes.

public/404.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BrowserRouter, Routes, Route } from 'react-router-dom';
1+
import { HashRouter, Routes, Route } from 'react-router-dom';
22
import { Layout } from './components/layout/Layout';
33
import { HomePage } from './pages/HomePage';
44
import { AboutPage } from './pages/AboutPage';
@@ -8,7 +8,7 @@ import { ContactPage } from './pages/ContactPage';
88

99
function App() {
1010
return (
11-
<BrowserRouter>
11+
<HashRouter>
1212
<Routes>
1313
<Route path="/" element={<Layout />}>
1414
<Route index element={<HomePage />} />
@@ -18,7 +18,7 @@ function App() {
1818
<Route path="contact" element={<ContactPage />} />
1919
</Route>
2020
</Routes>
21-
</BrowserRouter>
21+
</HashRouter>
2222
);
2323
}
2424

src/main.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@ import { createRoot } from 'react-dom/client'
33
import './index.css'
44
import App from './App.tsx'
55

6-
// Handle GitHub Pages SPA redirect
7-
// https://github.com/rafgraph/spa-github-pages
8-
(function(l) {
9-
if (l.search[1] === '/' ) {
10-
var decoded = l.search.slice(1).split('&').map(function(s) {
11-
return s.replace(/~and~/g, '&')
12-
}).join('?');
13-
window.history.replaceState(null, '',
14-
l.pathname.slice(0, -1) + decoded + l.hash
15-
);
16-
}
17-
}(window.location))
18-
196
createRoot(document.getElementById('root')!).render(
207
<StrictMode>
218
<App />

0 commit comments

Comments
 (0)