Skip to content

Commit

Permalink
[fix] Fix image path (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 authored Jan 17, 2025
1 parent 8dd3686 commit b64b741
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/(default-layout)/projects/[name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function ProjectDetailsPage({
const data = projectList[name as keyof typeof projectList] as ProjectData;
let imageSrc = data.banner_image;
if (!data.banner_image.includes('http')) {
imageSrc = env.NEXT_PUBLIC_BASE_PATH + data.banner_image;
imageSrc = env.NEXT_PUBLIC_BASE_PATH + '/' + data.banner_image;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion app/(hero-layout)/chapters/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function ChapterPage() {
<Image
sizes="100vw"
fill
src={env.NEXT_PUBLIC_BASE_PATH + chapter.image}
src={env.NEXT_PUBLIC_BASE_PATH + '/' + chapter.image}
alt={chapter.name}
objectFit="cover"
/>
Expand Down
6 changes: 5 additions & 1 deletion app/(hero-layout)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export default function HomePage() {
<div className="project-img img-container">
<Image
alt={projectData.title}
src={env.NEXT_PUBLIC_BASE_PATH + projectData.banner_image}
src={
env.NEXT_PUBLIC_BASE_PATH +
'/' +
projectData.banner_image
}
fill
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function ProjectCard({
}: ProjectCardProps) {
let imageSrc = banner_image;
if (!banner_image.includes('http')) {
imageSrc = env.NEXT_PUBLIC_BASE_PATH + banner_image;
imageSrc = env.NEXT_PUBLIC_BASE_PATH + '/' + banner_image;
}

return (
Expand Down

0 comments on commit b64b741

Please sign in to comment.