Jekyll on Github pages does not display images and has broken links

I am trying to host my Jekyll blog on Github pages. The blog is currently in real time here .

As you can see, the images are missing + when you click on the blogposts, it shows 404. How to fix it? Here is a link to my public blog repository, and here is 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.imtqy.com" # the base hostname & protocol for your site
baseurl: "/sam_yonski"
+4
source share
1 answer

In _config.yml install baseurl: /sam_yonski

and call resources with:

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

See the Jekyll documentation here

+9
source

All Articles