Skip to content

Commit 698fc37

Browse files
committed
page remove
1 parent 5bce1f7 commit 698fc37

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

app/(main)/resume/page.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use client'
2+
import { useEffect } from 'react';
3+
import { useRouter } from 'next/navigation';
4+
5+
export default function ResumeRedirect() {
6+
const router = useRouter();
7+
8+
useEffect(() => {
9+
// Try multiple possible filenames
10+
const possibleFilenames = [
11+
'/Martin%20Barker%20Resume.pdf',
12+
'/Martin_Barker_Resume.pdf',
13+
'/Martin Barker Resume.pdf'
14+
];
15+
16+
// Try to redirect to the first available file
17+
const tryRedirect = async (index = 0) => {
18+
if (index >= possibleFilenames.length) {
19+
// If none work, redirect to home
20+
router.push('/');
21+
return;
22+
}
23+
24+
try {
25+
const response = await fetch(possibleFilenames[index], { method: 'HEAD' });
26+
if (response.ok) {
27+
window.location.href = possibleFilenames[index];
28+
} else {
29+
tryRedirect(index + 1);
30+
}
31+
} catch (error) {
32+
tryRedirect(index + 1);
33+
}
34+
};
35+
36+
tryRedirect();
37+
}, [router]);
38+
39+
// Return nothing - completely invisible redirect
40+
return null;
41+
}

0 commit comments

Comments
 (0)