Github页面jekyll图像无法加载

问题描述

我正在尝试建立我的个人博客并在github页面上运行,由于某种原因,即使它在本地运行,我也无法在Github上显示任何图片

网站:https://ryanstull.github.io/

代码https://github.com/ryanstull/ryanstull.github.io

我尝试了其他类似问题的建议,例如仔细检查大小写并将图像从资产文件夹移到其自己的文件夹中,但这些似乎都没有任何作用。

当我进入期望图片的网址时,例如https://ryanstull.github.io/images/posts/classhierarchy.png。我只是收到此错误消息,关于包含错误的图像,即使它在本地也可以工作。

enter image description here

任何建议将不胜感激。

解决方法

所以事实证明问题出在github页面和git LFS不能一起工作,而我是用git LFS存储图片的。

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

我能够使用此注释https://github.com/git-lfs/git-lfs/issues/1342#issuecomment-334317440所建议的指向LFS二进制文件的硬编码链接来修复它

例如,我用于问题中发布的图片的链接为https://media.githubusercontent.com/media/ryanstull/ryanstull.github.io/master/images/posts/classhierarchy.png?raw=true