Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github Pages jekyll not loading CSS when using custom domain

My Jekyll blog on Github fails to load CSS and other site files when using a custom domain. I can only see the text.

The site works fine when I use the standard github.io domain (username.github.io/BLOG)

Every time I setup the blog's page on Github Pages as blog.domain.com, the site fails to load correctly.

Github repo: https://github.com/sabre45/BLOG

like image 607
sabre45 Avatar asked Oct 15 '25 18:10

sabre45


1 Answers

The problem is, as always, that the CSS path is not set correctly. If you use a custom domain, then please run locally first. If it works on your local machine, it will 99% of the time also work on a custom domain. This is because your custom domain and your local machine both NOT require a baseurl. This baseurl is a concept many people do not fully understand. Especially when it comes to multiple environments with different baseurls.

Hope this helps you solve/circumvent your problem.

like image 57
JoostS Avatar answered Oct 17 '25 10:10

JoostS