1.
NODEJS下载
2.
GIT下载
node -v
npm -v
git --version
hexo下载:npm install -g hexo-cli
hexo -v
3.
github账号注册
4.
生成ssh:ssh-keygen -t rsa -C “邮箱地址”
.ssh生成路径:C:\Users\用户名.ssh
测定ssh是否绑定成功:ssh -T git@github.com
5.
hexo init #初始化hexo博客
如果报错SyntaxError: Unexpected token …
建议更新一下node.js版本
hexo s #静态生成hexo页面 本地 localhost 查看
6.
配置文件修改(_config.yml)
deploy:
type: git
repository: https://github.com/你的名字/仓库的名字.git
branch: 分支
安装hexo-deployer-git自动部署发布工具:
-
npm install hexo-deployer-git --save
-
hexo d #上传部署
过程出现问题尝试使用
git config --global user.email “你的邮箱”
git config --global user.name “你的gihub名字”
然后
- hexo clean
- hexo g
- hexo d
7.
开始 DIY
比如添加第三方插件、注入 JS、CSS 定制样式
建议看官方文档
附上一张我搭建的效果图
推荐 HEXO 主题中的 Butterfly