Skip to content

Commit cd0fd66

Browse files
committed
Fix (MIME Issues)
1 parent 171977f commit cd0fd66

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

index.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/hxndev.github.io/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Hassan Shahzad | Portfolio</title>
8+
<!-- Script for handling client-side routing on GitHub Pages -->
9+
<script type="text/javascript">
10+
// Single Page Apps for GitHub Pages
11+
// MIT License
12+
// https://github.com/rafgraph/spa-github-pages
13+
(function(l) {
14+
if (l.search[1] === '/' ) {
15+
var decoded = l.search.slice(1).split('&').map(function(s) {
16+
return s.replace(/~and~/g, '&')
17+
}).join('?');
18+
window.history.replaceState(null, null,
19+
l.pathname.slice(0, -1) + decoded + l.hash
20+
);
21+
}
22+
}(window.location))
23+
</script>
824
</head>
925
<body>
1026
<div id="root"></div>
11-
<script type="module" src="/src/main.jsx"></script>
27+
<script type="module" src="/hxndev.github.io/src/main.jsx"></script>
1228
</body>
1329
</html>

public/404.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Hassan Shahzad | Portfolio</title>
6+
<script type="text/javascript">
7+
// Single Page Apps for GitHub Pages
8+
// MIT License
9+
// https://github.com/rafgraph/spa-github-pages
10+
var pathSegmentsToKeep = 1;
11+
var l = window.location;
12+
l.replace(
13+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
14+
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
15+
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
16+
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
17+
l.hash
18+
);
19+
</script>
20+
</head>
21+
<body>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)