Skip to content

Commit 0241511

Browse files
committed
Fix (Resume Download Error)
1 parent 25aacf2 commit 0241511

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/home/HeroSection.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const HeroSection = () => {
147147
<Group position="left" spacing="md" className="animate-item" ref={ctaRef}>
148148
<Button
149149
component="a"
150-
href="/hxndev.github.io/assets/resume/hassan_resume.pdf"
150+
href={resolveAssetPath('assets/resume/hassan_resume.pdf')}
151151
size="lg"
152152
leftSection={<IconDownload size={20} />}
153153
radius="xl"
@@ -162,7 +162,7 @@ const HeroSection = () => {
162162
boxShadow: '0 8px 20px rgba(155, 0, 255, 0.4)',
163163
},
164164
}}
165-
download
165+
download="hassan_resume.pdf"
166166
>
167167
Download Resume
168168
</Button>

src/components/utils/paths.jsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export function resolvePath(path) {
2626
/**
2727
* Resolves an asset path
2828
*/
29+
/**
30+
* Resolves an asset path
31+
* Works for both development and GitHub Pages environments
32+
*/
2933
export function resolveAssetPath(path) {
3034
// Handle external URLs
3135
if (path.startsWith('http')) {
@@ -35,6 +39,7 @@ export function resolveAssetPath(path) {
3539
// Remove leading slash if present
3640
const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
3741

38-
// In production, assets are at the root
39-
return `${BASE_PATH}/${normalizedPath}`;
42+
// Keep it simple - for both GitHub Pages personal site (username.github.io)
43+
// and local development, assets are served from the root
44+
return `/${normalizedPath}`;
4045
}

0 commit comments

Comments
 (0)