Github IO page does not load CSS

喜夏-厌秋 提交于 2019-12-12 03:05:52

问题


Question

I would like to understand why my CSS resources are not loaded on my personal Github IO page tobias-schmidt.site.

Issue

When I acess my page via the custom dns tobias-schmidt.site or via the direct github dns mrtobe.github.io the site correctly loads the index.html but not the referenced CSS files. When I click on the blog post it does correctly load the CSS. Then for this surfing session the CSS is also available on the index.html.

Setup

  • dns from GoDaddy with A-Record setup for tobias-schmidt.site - this dns was added in the settings of the github repo
  • Website is generated with hugo - full project is hosted under https://github.com/mrtobe/mrtobe-hugo - ./deloy.sh is used to deploy the page
  • Hugo generates a static website that is hosted here https://github.com/mrtobe/mrtobe.github.io

Best guess

I checked different posts and found that it might be mixed content, but I have no idea on how to solve this with github pages.


回答1:


You have a SSL certificate problem.

tobias-schmidt.site uses an invalid security certificate.

The certificate is only valid for the following names: *.github.com, github.com, *.github.io

Error code: SSL_ERROR_BAD_CERT_DOMAIN

Github pages doesn't provide HTTPS for custom domains.

When you access https://tobias-schmidt.site github pages server is sending his certificate which is not valid for your domain and browser are blocking request until you agree using this certificate.

For now, in conf.toml, you have to set baseurl = "http://tobias-schmidt.site". This in order to have hugo craft http urls.

In a second time, you can try to secure you site with services like cloudflare or have a look at Netlify.



来源:https://stackoverflow.com/questions/40827124/github-io-page-does-not-load-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!