Skip to content

Commit ae6207b

Browse files
authored
Merge pull request #162 from MartinBarker/resumefallback
Resume fallback
2 parents 9dabce3 + 698fc37 commit ae6207b

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

app/(main)/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ export default function RootLayout({ children }) {
547547
</button>
548548
<ul className={`${styles.contactList} ${contactExpanded ? styles.expanded : ''}`}>
549549
<li>
550-
<a href="/Martin_Barker_Resume.pdf"
550+
<a href="/resume"
551551
target="_blank"
552552
rel="noopener noreferrer"
553553
className={styles.contactItem}

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+
}

app/(main)/routeInfo.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ export const routeInfo = {
5050
subtitle: "Batch render Audacity audio tracks with Discogs metadata",
5151
tabTitle: "Vinyl2Digital - Vinyl Digitization Tool",
5252
icon: "/ico/martinbarker.ico"
53+
},
54+
"/auto-split": {
55+
title: "Auto-Split Tool",
56+
subtitle: "Detect silence in audio files with waveform visualization",
57+
tabTitle: "Auto-Split Tool - Audio Silence Detection",
58+
icon: "/ico/martinbarker.ico"
59+
},
60+
"/waveform-visualizer": {
61+
title: "Waveform Visualizer",
62+
subtitle: "Visualize audio waveforms with interactive playback",
63+
tabTitle: "Waveform Visualizer - Audio Waveform Display",
64+
icon: "/ico/martinbarker.ico"
5365
}
5466
};
5567

0 commit comments

Comments
 (0)