Github页面上的Jekyll不显示图像并且链接断开 [英] Jekyll on Github pages not displaying images and has broken links

查看:88
本文介绍了Github页面上的Jekyll不显示图像并且链接断开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在Github页面上托管我的Jekyll博客.该博客当前位于此处.

I'm trying to host my Jekyll blog on Github pages. The blog is currently live here.

如您所见,单击博客文章时图像丢失+,它显示404.如何解决此问题? 这是指向我的公共博客存储库的链接,这是我的_config.yml文件:

As you can see, the images are missing + when you click on the blogposts, it shows 404. How to fix this? Here's the link to my public blog repo, and here's my _config.yml file:

# 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

In _config.yml set 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文档

这篇关于Github页面上的Jekyll不显示图像并且链接断开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆