【问题标题】:image in github wont load in github pagegithub中的图像不会加载到github页面中
【发布时间】:2015-05-06 19:10:44
【问题描述】:

我正在尝试用 gitub 制作一个网站,但遇到了几个问题

  1. 我有一个 github 存储库https://github.com/yonicd/Elections。在 \images 子目录和 \www 子目录中找到的图像可以很好地加载到 readme.md 但是当我尝试访问github 网页上的相同图像,它们已断开链接

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

我正在markdown中写图片链接

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

如你所见:

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

  1. 当我在 R 中编译 md 代码时,编号列表会正确显示,但是当我从 github 中加载自述文件 html 时,编号列表会在每个编号上重置,请参阅工作表使用区域。

https://github.com/yonicd/Elections

【问题讨论】:

    标签: r markdown github-pages github-flavored-markdown


    【解决方案1】:

    您似乎需要更改它试图从中获取图像的网址。

    例如:

    目前正在使用-

    <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/

    【讨论】:

      猜你喜欢
      • 2019-04-30
      • 2021-01-14
      • 2020-12-04
      • 2011-11-30
      • 1970-01-01
      • 1970-01-01
      • 2022-01-10
      • 2018-12-16
      • 1970-01-01
      相关资源
      最近更新 更多