1.Node.js安装
2.Git安装
node -v #cmd窗口检查node.js安装是否成功
npm -v #检查Git下的工具是否安装成功
git --version #检查git版本
hexo下载:npm install hexo-cli -g
3.github账号注册和搭建仓库
创建仓库名:GitHub用户名.github.io
勾选
4.生成SSH
在git中生成ssh
ssh-keygen -t rsa -C "邮箱地址"
.ssh生成路径:
C:\Users\电脑用户名\.ssh
测定ssh是否绑定成功:
ssh -T git@github.com
如果一直出现ssh: connect to host github.com port 22: Connection refused的话具体看这个教程https://www.cnblogs.com/Archer314/p/14641310.html
5.本地生成博客内容
在本地创建文件,打开git bash 输入命令
npm install -g hexo #安装hexo
hexo init #初始化hexo
hexo g #生成
hexo s #启动
6.发布博客到互联网
配置文件修改(_config.yml)
deploy:
type: git
repository:https://github.com/你的名字/仓库的名字.git
branch: 分支
npm install hexo-deployer-git --save #安装hexo-deployer-git自动部署发布工具:
hexo g #生成页面
hexo d #上传