Bluetom

hexo升级https

ssl申请

  • 申请免费的SSL,注册clouldflare服务商的服务.
  • 登陆后将nameserver设置成clouldflare提供的地址

ssl设置

  • cname转向bluetomlee.github.io
  • 后台顶部的Crypto中,进入Crypto,将SSL选项设置为“Flexible”,这个的意思是访客到cf的过程是加密的,而cf到github pages不是加密的
  • 将hexo根目录配置文件_config.yml,
    添加url: https://liyi.it
    enforce_ssl: https://liyi.it

解决多说评论https

多说大部分资源已经支持了https协议,但是头像地址仍是http,所以会导致地址栏变灰色,不能直视。

解决方案如下:
将多说embed.js下载至hexo本地,
然后将https://liyi.it/js/embed.js本地页面引入,
找到560行

1
2
3
avatarUrl: function(e) {
return e.avatar_url || rt.data.default_avatar_url
},

修改如下代码

1
2
3
4
5
6
avatarUrl: function(e) {
if(location.protocol === 'https:') {
return 'https://liyi.it/img/avatar.jpeg';
}
return e.avatar_url || rt.data.default_avatar_url
},

首页、文章页均为绿色。不过表情的静态资源仍是http。

解决方案两种:
1.替换为本地表情
2.直接用disqus,支持https协议

done,效果如下

Bluetom

作为挨踢业的前段湿 搬过砖也画过画:爱看、爱听、爱玩儿、爱折腾、爱打撸啊撸、intj

Proudly published with Hexo