首页 > 解决方案 > 图片未显示在 jerkyll 博客文章中

问题描述

我尝试在我的 github 博客文章(我使用 jekyll 创建)中显示图像:

<img src = "./images/scatterplot.png" width="400" height="300" />

该图像显示在降价文件中,但无法在实际博客中输出。任何建议都会非常有帮助,在此先感谢!

正如其中一个回复中提到的,我试图打开图片链接:https://surajsubramanian.github.io/posts/simple-linear-regression-from-scratch/images/scatterplot.png 这很奇怪,为什么它在路径中取了我的帖子的名称。

路径应该是 https://surajsubramanian.github.io/posts/images/scatterplot.png

标签: htmlgithubmarkdown

解决方案


这里是 img 的正确链接: https ://raw.githubusercontent.com/SurajSubramanian/SurajSubramanian.github.io/master/_posts/images/scatterplot.png

要在网络浏览器上知道图片的 URL(右键单击图片 -> 在新选项卡中打开图片,您会得到正确的 URL)

img 会是这样的:

<img src="https://raw.githubusercontent.com/SurajSubramanian/SurajSubramanian.github.io/master/_posts/images/scatterplot.png" width="400" height="300" />

推荐阅读