首页 文章

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

提问于
浏览
4

我正试图在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 回答

  • 10

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

相关问题