上一节介绍了如何发布静态网页到github,但考虑到国内网速原因,想同时时间github和gitee多个托管网站,方便访问
同时发布到github和gitee
上一篇已经介绍如何发布到github,这里先介绍新建gitee项目
在
gitee上创建名为xxx的项目(与github有所区别),xxx为自己的gitee用户名设置项目的类型为
JavaScript配置
deploy多个源,官方的格式是1
2
3
4
5
6
7
8
9
10
11
12
13
14# 官方的格式
# deploy:
# type: git
# message: [message]
# repo:
# github: <repository url>,[branch]
# gitcafe: <repository url>,[branch]
# 我的配置
deploy:
type: git
repo:
github: git@github.com:coofive/coofive.github.io.git,master
gitee: git@gitee.com:coofive/coofive.git,master将hexo提交到github,实现多台电脑使用
在本地创建分支
hexo1
git checkout -b hexo
查看分支状态
1
git branch
本地
commit后,提交本地分支到远程分支1
2
3
4git add .
git commit -m "hexo博客"
git remote add origin git@github.com:liu253928127/liu253928127.github.io.git
git push -u origin hexo有可能发布后样式加载不出来,一般是css路径访问不对,所以在gitee创建项目的时候按照固定格式来最好