之前的hexo博客一直托管在GitHub,最近发现也可以托管在国内的Coding上,下面就记录下本次托管到Coding的过程。
注册
首先在需要Coding网站注册账号,点这里进行注册。Coding可以免费托管开源代码,同时他让用户免费建立私有库,提供的服务挺好的,是国内的网站。
创建项目

项目名称最好和Coding用户名相同,这样最后直接访问hoxis.coding.me即可。
开启Pages服务

因为之前配置是master分支,所以这里Pages部署来源填master分支。
_config.yml文件配置
需要按如下配置,可以同时push到GitHub和Coding,需要将其中的代码仓库地址修改为自己的。
deploy:
- type: git
repo: https://github.com/hoxis/hoxis.github.io.git
branch: master
- type: git
repo: https://git.coding.net/hoxis/hoxis.git
branch: master
之前网上看的如下这种配置并不行:
deploy:
type: git
repo:
github: https://github.com/hoxis/hoxis.github.io.git,master
coding: https://git.coding.net/hoxis/hoxis.git,master
结果
最终,运行hexo g
和hexo d
后,可以将博客同时部署到了两个服务器上。就可以通过两个地址进行访问了。
https://hoxis.github.io
https://hoxis.coding.me
网友评论