问题
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