说明
之前顺利从GitHub上构建了静态博客,但是考虑到访问速度问题,决定将原来的博客迁移到Gitee同步部署。但是,设置上略有不同,此处所记录的就是这个设置过程。
在站点根目录下找到_config.yml,将里边的deploy节点修改成下边的形式,其中repository等于username,即
站点配置的设置
{% tabs 站点配置, [index] %}
GitHub Pages 中文版
GitHub Pages 英文版
1
2
3
4
| # URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://fengzhenhua-vip.github.io
root: /
|
当你在点击博客标题时要跳转到本站的某个站点时,请在root后转入那个站点的目录。如果像我这样仅需要一个博客,那就只保留一个根目录就可以了。
Gitee Pages 中文版
Gitee Pages 英文版
1
2
3
4
| # URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://fengzhenhua.gitee.io
root: /
|
当你在点击博客标题时要跳转到本站的某个站点时,请在root后转入那个站点的目录。如果像我这样仅需要一个博客,那就只保留一个根目录就可以了。
{% endtabs %}
部署地址的不同设置
{% tabs 部署地址配置 , [index] %}
1
2
3
4
| deploy:
type: git
repo:
github: git@github.com:[username]/[username].github.io.git,master
|
将上边的仓库url的[username]/[repository]改成自己的项目地址,这里使用的是SSH协议的Git仓库地址,即:
1
| git@[domain]:[username]/[username].git
|
例如我部署到Github上的配置为
1
2
3
4
5
6
| # Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
repository: git@github.com:fengzhenhua-vip/fengzhenhua-vip.github.io.git
branch: master
|
1
2
3
4
| deploy:
type: git
repo:
gitee: git@gitee.com:[username]/[username].git,master
|
将上边的仓库url的[username]/[repository]改成自己的项目地址,这里使用的是SSH协议的Git仓库地址,即:
1
| git@[domain]:[username]/[username].git
|
例如我部署到Gitee上的配置为
1
2
3
4
5
6
| # Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
repository: git@gitee_key_one:fengzhenhua/fengzhenhua.git
branch: master
|
{% endtabs %}