Search code examples
imagegithubjekyllgithub-pages

Github pages jekyll images not loading


I'm trying to get my personal blog up and running on github pages, and for some reason I can't get any of the pictures to display on Github, even though it works locally.

Website: https://ryanstull.github.io/

Code: https://github.com/ryanstull/ryanstull.github.io

I tried suggestions for other similar questions, such as double checking capitalization and moving the images out of the assets folder into their own folder, but neither of those seems to do anything.

When I go the a url where I'm expecting a picture to be, https://ryanstull.github.io/images/posts/classhierarchy.png for example. I just get this error message, about the image containing errors, even though it works locally.

enter image description here

Any advice would be much appreciated.


Solution

  • So it turns out the problem was github pages and git LFS don't work together, and I was storing my pictures with git LFS.

    https://zhouchenzc0824.github.io/2017/05/GitHub-pages-incompatibility-with-Git-LFS/

    I was able to fix it by using a hard-coded link to the LFS's binary as suggested by this comment https://github.com/git-lfs/git-lfs/issues/1342#issuecomment-334317440

    For example, the link that I used for the picture that I posted in the question is https://media.githubusercontent.com/media/ryanstull/ryanstull.github.io/master/images/posts/classhierarchy.png?raw=true