Jekyll在Github页面上没有显示图像并且链接断开

时间:2015-03-02 22:50:22

标签: jekyll github-pages

我试图在Github网页上托管我的Jekyll博客。该博客目前正在进行here

如您所见,图片丢失+当您点击博客帖子时,它显示404.如何解决此问题? Here's the link到我的公开博客仓库,这是我的_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"

1 个答案:

答案 0 :(得分:11)

在_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>

请参阅Jekyll documentation here

相关问题