【发布时间】:2021-08-25 14:40:18
【问题描述】:
我想使用 Jekyll 托管一个带有 Github 页面的简单博客站点。在帖子中,我想显示图像。为此,我在项目目录的根目录中的_includes 文件夹中添加了一个image.html 文件。
我在 image.html 文件中构建了一个 HTML 结构,如下所示:
<figure class="image" style="display: flex; flex-direction: column; align-items: center; justify-content: space-between">
<img src="https://raw.githubusercontent.com/Ritobrato{{include.baseurl}}/gh-pages/_posts" alt="{{ include.description }}">
<div style="padding-top: 10px"></div>
<figcaption>{{ include.description }}</figcaption></figure>
接下来,我在根目录的_posts 目录中添加了一个新的降价文件。我正在尝试在 .md 发布文件中包含图像,如下所示:
{% include image.html url="/images/trek1.jpg" description="This is a trek image" %}
但是,在提交和代码推送到 GitHub 仓库后,GitHub 页面无法显示图像。 Click here to see the image display error。 链接到我在 Github repo 上的代码:- https://github.com/Ritobrato/testBlog
在阅读了关于 stackoverflow 的所有类似问题后,这似乎是一个文件链接问题。请帮忙!谢谢
【问题讨论】:
标签: ruby-on-rails ruby github jekyll github-pages