首页 > 随笔档案 > Jekyll https css no loading on http site

Jekyll https css no loading on http site

Publish:

摘自:stackoverflow

When linking a resource to your document, you don’t need to explicitly set http: or https:, only double slashes // will work fine, it will base on the current protocol of the page:

<link rel="stylesheet" href="//wys35.github.io/css/main.css">

Try setting url in _config.yml to "//wys35.github.io"

简单的说jekyll搭建的blog,在http下正常,在https下css无法加载,错误代码:SSL_ERROR_BAD_CERT_DOMAIN

查看调试器发现在http网页调用了https的css, 当然是因为对jekyll还不很熟悉.

_config.yml 原本配置: url: https://www.levyleo.cn 改为:url: //www.levyleo.cn 即可

声明: 本文采用 BY-NC-SA 授权。转载请注明转自: levy