.png 图像未出现在 github 页面站点中

问题描述 投票:0回答:1

我使用 jekyll 构建了我的网站,并一直在查看 stackoverflow 来尝试解决我的问题(.md 文件中的图像渲染用于生成帖子,但帖子本身不显示图像)。

  • my github.io blog post
  • root of my website project
  • when in _posts/2023/10/23/Delivery-Time-Prediction

使用此stackoverflow链接

我添加了

/assets
并在其中放置了测试图像。然后我在我的 __posts/post.md 文件 中引用了它并在那里渲染。然而,当我点击post时,图片并没有出现。我还尝试将
include: - "_posts"
添加到我的 _config.yml 文件中,但这也不起作用。

这是在 .md 文件中渲染图像的常用 Markdown 代码:

![nominal_distribution](nom_dist.png)

这是我的配置文件中的代码:

markdown: kramdown
permalink: /blog/:year/:month/:day/:title
include: - "_posts" 

请指教。预先感谢您。

image jekyll github-pages
1个回答
0
投票

当您将图像放入

/assets/images/
时,您可以从任何帖子文件访问它们,例如

![image](/assets/images/image.png)
© www.soinside.com 2019 - 2024. All rights reserved.