Github Pages jekyll not loading CSS when using custom domain

Viewed 960

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

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.

Related