gregrickaby / nextjs-github-pages

🚀 Deploy a Next.js app to GitHub Pages via GitHub Actions.

Home Page:https://gregrickaby.github.io/nextjs-github-pages/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alternative for Adding basePath to image src

MrMirfan opened this issue · comments

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"

@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