Github 页面上的 Jekyll 未显示图像且链接已损坏
Jekyll on Github pages not displaying images and has broken links
我正在尝试在 Github 页面上托管我的 Jekyll 博客。该博客目前已上线 here。
如您所见,图片丢失 + 当您点击博文时,它显示 404。如何解决这个问题? Here's the link 到我的 public 博客仓库,这是我的 _config.yml 文件:
# Build settings
markdown: redcarpet
highlighter: pygments
# Site settings
title: "Sam Yonski"
description: > # this means to ignore newlines until "email:"
Reading and writing...
email: sam.yonski@gmail.com
#blog logo
logo: "/assets/images/sam_yonski_logo.png"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Sam Yonski'
author: 'Sam Yonski'
author_image: "/assets/images/author.jpg"
paginate: 5
url: "https://ofcan.github.io" # the base hostname & protocol for your site
baseurl: "/sam_yonski"
在_config.yml中设置baseurl: /sam_yonski
并通过以下方式调用您的资源:
<link rel="stylesheet" href="{{ site.baseurl }}/css/css.css">
<script src="{{ site.baseurl }}/js/scripts.js"></script>
<img src="{{ site.baseurl }}/path/to/img/toto.jpg">
<a href="{{ site.baseurl }}/linkto/">Link</a>
我正在尝试在 Github 页面上托管我的 Jekyll 博客。该博客目前已上线 here。
如您所见,图片丢失 + 当您点击博文时,它显示 404。如何解决这个问题? Here's the link 到我的 public 博客仓库,这是我的 _config.yml 文件:
# Build settings
markdown: redcarpet
highlighter: pygments
# Site settings
title: "Sam Yonski"
description: > # this means to ignore newlines until "email:"
Reading and writing...
email: sam.yonski@gmail.com
#blog logo
logo: "/assets/images/sam_yonski_logo.png"
# blog cover
cover: "/assets/images/cA4aKEIPQrerBnp1yGHv_IMG_9534-3-2.jpg"
name: 'Sam Yonski'
author: 'Sam Yonski'
author_image: "/assets/images/author.jpg"
paginate: 5
url: "https://ofcan.github.io" # the base hostname & protocol for your site
baseurl: "/sam_yonski"
在_config.yml中设置baseurl: /sam_yonski
并通过以下方式调用您的资源:
<link rel="stylesheet" href="{{ site.baseurl }}/css/css.css">
<script src="{{ site.baseurl }}/js/scripts.js"></script>
<img src="{{ site.baseurl }}/path/to/img/toto.jpg">
<a href="{{ site.baseurl }}/linkto/">Link</a>