Skip to content

Commit b838e92

Browse files
TurtleWolfeclaude
andcommitted
fix: prepend basePath to portfolio images for GitHub Pages deployment
Next.js <Image> with unoptimized:true does not auto-prepend basePath to src attributes. Portfolio images were loading as /portfolio/... but GitHub Pages serves from /TurtleWolfe/ subpath, causing 404s. Apply the same detectedConfig.basePath pattern already used by LayeredTurtleWolfeLogo to ProjectShowcaseCard and CaseStudyLayout. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fc4907a commit b838e92

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/components/molecular/ProjectShowcaseCard/ProjectShowcaseCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import Image from 'next/image';
33
import Link from 'next/link';
4+
import { detectedConfig } from '@/config/project-detected';
45

56
export interface ProjectShowcaseCardProps {
67
title: string;
@@ -37,7 +38,7 @@ export default function ProjectShowcaseCard({
3738
{image ? (
3839
<figure className="relative aspect-video w-full overflow-hidden">
3940
<Image
40-
src={image.src}
41+
src={`${detectedConfig.basePath}${image.src}`}
4142
alt={image.alt}
4243
fill
4344
className="object-cover transition-transform duration-300 group-hover:scale-105"

src/components/templates/CaseStudyLayout/CaseStudyLayout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Image from 'next/image';
33
import Link from 'next/link';
44
import CTABanner from '@/components/molecular/CTABanner';
5+
import { detectedConfig } from '@/config/project-detected';
56

67
export interface CaseStudyImage {
78
src: string;
@@ -43,7 +44,7 @@ export default function CaseStudyLayout({
4344
{project.heroImage && (
4445
<div className="relative h-64 w-full sm:h-80 md:h-96 lg:h-[28rem]">
4546
<Image
46-
src={project.heroImage.src}
47+
src={`${detectedConfig.basePath}${project.heroImage.src}`}
4748
alt={project.heroImage.alt}
4849
fill
4950
className="object-cover"
@@ -128,7 +129,7 @@ export default function CaseStudyLayout({
128129
className="overflow-hidden rounded-lg shadow-md"
129130
>
130131
<Image
131-
src={img.src}
132+
src={`${detectedConfig.basePath}${img.src}`}
132133
alt={img.alt}
133134
width={600}
134135
height={400}

0 commit comments

Comments
 (0)