Skip to content

Commit

Permalink
Merge pull request #74 from fuzue/fix-images-path-on-github-pages
Browse files Browse the repository at this point in the history
Fix images path using  VITE_BASE_URL from .env (Fix #70)
  • Loading branch information
elenavolpato authored Aug 22, 2023
2 parents 6bb683e + 397ae46 commit 95566d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Item(props: FoodObject) {
<Box position="relative" flexGrow={1}>
<img
className="food-image"
src={`../images/${image}.png`}
src={`${import.meta.env.VITE_BASE_URL}images/${image}.png`}
alt={`image of ${image}`}
/>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/FoodPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function FoodPage() {
<ImgBox borderRadius={1}>
<img
className="food-image"
src={`../images/${image}.png`}
src={`${import.meta.env.VITE_BASE_URL}images/${image}.png`}
alt={`photo of ${image}`}
/>
</ImgBox>
Expand Down

0 comments on commit 95566d1

Please sign in to comment.