4

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

2
  • _config.yml, "baseurl: /dark-side" -> "baseurl: /BLOG" Commented Jan 16, 2019 at 3:58
  • Ah. I changed the name of the repo. The fix had no effect on Jekyll Commented Jan 16, 2019 at 6:08

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, this helped me as well. While testing locally I had never setup the url in _config.yml, this didn't create an issue until I changed the custom domain. After pushing the change with the right url blog.mydomain.tld the CSS styling works again.
Same problem. When you say "setup url in _config.yml" do you mean the "url" property?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.