首页 文章

github中的图像不会在github页面中加载

提问于
浏览
0

我正在尝试从gitub创建一个网站,并遇到了一些问题

  • 我有一个github存储库https://github.com/yonicd/Elections . 在 \images subdir和 \www subdir中找到的图像可以很好地加载到 readme.md 但是当我尝试在网站的github网页上获取相同的图像时,他们已经断开了链接

http://yonicd.github.io/Elections/

我正在写下降价图像链接

![Current Day](https://github.com/yonicd/Elections/blob/master/images/LastDayPlot.png)

正如你所看到的那样:

https://github.com/yonicd/Elections/tree/master/images

  • 当我在R中编译md代码时,编号列表正确地出来但是当我从github中加载readme html时,编号列表在每个数字上重置,请参见表单使用区域 .

https://github.com/yonicd/Elections

1 回答

  • 2

    看起来你需要更改它试图从中获取图像的URL .

    For example:

    目前使用 -

    <p><img src="https://github.com/yonicd/Elections/blob/master/images/pad_screen_grab.png"
    alt="Snapshot of Election Analysis Page"></p>
    

    改成 -

    <p><img src="https://raw.githubusercontent.com/yonicd/Elections/master/images/pad_screen_grab.png"
    alt="Snapshot of Election Analysis Page"></p>
    

    正如您所看到的,如果您点击它们,第一个将链接到GitHub仓库中图像的位置,而第二个将只给您原始图像文件 .

    编辑:你可以看到它在这个演示中工作 - http://jsfiddle.net/ghnfrr1r/

相关问题