环境要求
- node.js > 10.13
- git
- Hexo
- 默认你晓得Hexo的应用办法
创立一个仓库(repository)
- 进入GitHub,右上角点击 New repository
- 将Repository name设置成
你的用户名.github.io
,留神,用户名必须跟你的截然不同 - 复制GitHub连贯
git@github.com:Chenilove/Chenilove.github.io.git
,留神这里用HTTPS的话每次提交都要登录,举荐SSH 在Hexo我的项目根目录下,编辑
_config.yml
文件,外面批改# Deployment## Docs: https://hexo.io/docs/one-command-deploymentdeploy: - type: git # 提交类型git repo: git@github.com:Chenilove/Chenilove.github.io.git # 提交仓库地址 branch: main # 分支GitHub的默认分支是main Gitee的分支是master 能够填branch让hexo默认提交 message: message # 提交信息
执行我的项目生成和部署命令
hexo ghexo d
- 最初拜访 https://chenilove.github.io/ 就能够了
issues
- 执行
hexo d
每次都要登录是怎么回事?将
_config.yml
里的repo
改成SSH(git@github.com)的链接就行了