简体   繁体   中英

GitHub Pages (jekyll blog) showed 404

I tried to build up a Jekyll blog website using GitHub pages. I could check the homepage, but the subpages (about & blogposts) showed 404.

To find out where the problem is, I opened a new repo. And I set up the basic things of a Jekyll site using jekyll new. locally and uploaded them to the Github repo. I did not change anything after this step.

And then, I used jekyll serve to run the local test, and everything went well. The layout looked nice and I could check the first blog "Welcome to Jekyll."(built by default).

However, when I used the link of GitHub Pages to check, the layout of the homepage looked quite different, and I could not check the default blogpost "Welcome to Jekyll,". which showed me 404.

How can I fix it?

This is my repo: https://github.com/jl-xie-kcl/blog20211122

(you can check the screenshots in issue 2 https://github.com/jl-xie-kcl/blog20211122/issues/2 )

Those pages do work, your links are just incorrect because your blog is not at the root of your domain — and this goes the same for the style and images not working, by the way:


In order to fix this, you will have to change the baseurl value in your _ config.yml to:

baseurl: "/blog20211122"

As stated by the comment on this configuration line :

baseurl: "" # the subpath of your site, e.g. /blog

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM