用code作为博客托管并且避免github ssh覆盖
参考
https://cloud.tencent.com/developer/article/1500458
本文是个人博客搭建系列的第三篇,主讲博客的多种托管方式。
github page毕竟是国外站点,访问速度相对来说比较慢,但是同时你又想在gihub上保存一下代码,可以尝试同时托管两个仓库。
做解析的时候海外的ip 指向到github,国内的或者说百度的直接指向coding
1.
在coding上提交代码
首先做的操作和github是一样的,就是创建一个ssh。
这里要注意的是,你的电脑上已经有了gihub的ssh,如果还像github一样一路回车会把gihub的ssh给覆盖掉。
所以这里在执行
$ ssh-keygen -t rsa -C "youremail@example.com"
时要注意,给生成的文件配置一个新路径:

然后配置生成的ssh

在coding中创建一个仓库,这里注意仓库的名字可以随意取,不像gihub一样可以随意给定。
将创建仓库的git地址添加到_config.yml中:
deploy: type: git repo:
github: https://github.com/ConardLi/ConardLi.github.io.gitcoding: https://git.dev.tencent.com/ConardLi/lisqBlog.gitbranch: master
然后重新部署并上传博客,去仓库查看代码证明上传成功:

2
开启coding page
点击coding的pages服务,直接点击一键开启即可。
开启后即可通过给定域名直接访问了:
http://conardli.coding.me/
3
将新生成的coding域名进行解析,这样国内就默认访问coding的页面,比github要快不少。

另外还可以将github的ip进行国外站点配置。
在coding page中将自己的域名进行绑定。

配置完成后发现速度快了不少,有木有...