为什么图像托管在 github 中时未加载到 jekyll 中?
Why is image not loading in jekyll when hosted in github?
我有一个使用 jekyll 制作的博客,托管在 https://github.com/rocka0/myblog。我想知道为什么我的图片没有加载到“关于我”页面中。
图片的错误是:无法加载资源:服务器响应状态为 404(未找到)。
来自 this config, your rocka0/myblog/_config.yml#L3-L4
应该是:
# Your website URL (e.g. http://barryclark.github.io or http://www.barryclark.co)
# Used for Sitemap.xml and your RSS feed
url: http://rocka0.github.io/
# If you're hosting your site at a Project repository on GitHub pages
# (http://yourusername.github.io/repository-name)
# and NOT your User repository (http://yourusername.github.io)
# then add in the baseurl here, like this: "/repository-name"
baseurl: "/myblog"
作者图片(马里奥的 Geekstatic Facebook 头像)是方形的。其他一切都很好。案件还可以。但是当我查看您的 config.yml
时,您的 baseurl 是 /myblog
。将其改回正确的子路径 /myblog/
此外,请检查您的 url
(#您站点的基本主机名和协议)是否指向 config.yml
中的 http://rocka0.github.io/myblog
将您的 baseurl
设置为 /myblog
(没有尾部斜杠)并使用
调用您的图像
<img itemprop="image" class="img-rounded" src="{{ site.baseurl }}/assets/img/blog-author.jpg" alt="Tush Chen">
我有一个使用 jekyll 制作的博客,托管在 https://github.com/rocka0/myblog。我想知道为什么我的图片没有加载到“关于我”页面中。
图片的错误是:无法加载资源:服务器响应状态为 404(未找到)。
来自 this config, your rocka0/myblog/_config.yml#L3-L4
应该是:
# Your website URL (e.g. http://barryclark.github.io or http://www.barryclark.co)
# Used for Sitemap.xml and your RSS feed
url: http://rocka0.github.io/
# If you're hosting your site at a Project repository on GitHub pages
# (http://yourusername.github.io/repository-name)
# and NOT your User repository (http://yourusername.github.io)
# then add in the baseurl here, like this: "/repository-name"
baseurl: "/myblog"
作者图片(马里奥的 Geekstatic Facebook 头像)是方形的。其他一切都很好。案件还可以。但是当我查看您的 config.yml
时,您的 baseurl 是 /myblog
。将其改回正确的子路径 /myblog/
此外,请检查您的 url
(#您站点的基本主机名和协议)是否指向 config.yml
将您的 baseurl
设置为 /myblog
(没有尾部斜杠)并使用
<img itemprop="image" class="img-rounded" src="{{ site.baseurl }}/assets/img/blog-author.jpg" alt="Tush Chen">