gregrickaby / nextjs-github-pages

🚀 Deploy a Next.js app to GitHub Pages via GitHub Actions.
https://gregrickaby.github.io/nextjs-github-pages/
MIT License
448 stars 61 forks source link

Alternative for Adding basePath to image src #58

Closed MrMirfan closed 7 months ago

MrMirfan commented 7 months ago

Instead of Adding BasePath like this

src="/nextjs-github-pages/vercel.svg"

We can prepend the src with . and it works on Both Local and Prod

src="./profile/passport.avif"

realChakrawarti commented 7 months ago

@MrMirfan You mean here https://github.com/gregrickaby/nextjs-github-pages/blob/main/app/page.tsx#L20 ? So, instead of src="/nextjs-github-pages/vercel.svg", we could write src="./vercel.svg" ?

I am facing an issue where images public images doesn't load, https://realchakrawarti.github.io/aham/. Link to the repo: https://github.com/realChakrawarti/aham