简体   繁体   中英

GitHub Pages not pulling images

I am very new to GitHub. I made a repo with my main project in it and everything seems to be working fine. I then made another repo and even though HTML and CSS seem to be pulling through alright my images won't show up.

I understand GitHub is case sensitive and I don't believe that's the issue. My only theory is that maybe because it's not the main repo the path of the images should change on my markup? I have no clue. It's been up for nearly an hour so it couldn't be that it needs a couple of minutes to pull the images either.

Here is the link to the repo https://github.com/NikolaosKalfas/fleshformers.git (I hope this is how you link a repo).

Any help would be appreciated, Thanks a lot!

Your site is currently being visible at https://nikolaoskalfas.github.io/fleshformers/ . You use absolute paths for images, like /dist/images/Logo.png . This makes the full URL to the image https://nikolaoskalfas.github.io/dist/images/Logo.png and Github returns error 404 as it doesn't have the image at the URL. The correct URL is https://nikolaoskalfas.github.io/fleshformers/dist/images/Logo.png .

My advice is to use relative URLs like ../dist/images/Logo.png or ../../dist/images/Logo.png depending on the path to the HTML files. This way your site will work regardless of the prefix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM