3
votes

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
_config.yml, "baseurl: /dark-side" -> "baseurl: /BLOG" - Geno Chen
Ah. I changed the name of the repo. The fix had no effect on Jekyll - sabre45

1 Answers

3
votes

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.