I Like
I Like

Reputation: 1847

github pages images not showing

My images won't show up on an Angular 2 app on Github Pages. I could see the images during the app's development, but now the relative link returns the error: Failed to Load Resource on inspection.

The image link from development looks like this:

/assets/images/juno.gif

I tried copying the path from repo, but the image still doesn't show

mybiography/src/assets/images/juno.gif

I also tried copying the github link to the image file, but my Angular CLI service redirects me back to the application's home page.

https://github.com/st4rgut22/mybiography/blob/master/src/assets/images/juno.gif

Please advise what I should do, here's the link to the page where the images fail to show upon dropdown selection: https://st4rgut22.github.io/mybiography/work

Upvotes: 1

Views: 2042

Answers (1)

Sajib Khan
Sajib Khan

Reputation: 24156

When using relative path just start src path with ./

Change src="/assets/images/rot.gif" to src="./assets/images/rot.gif"

N.B. ./ denotes the current location

Upvotes: 6

Related Questions