配置HEXO

HEXO安装

安装nodejs

1
2
3
4
5
安装nodejs:去https://nodejs.org/en/ 下载安装
npm install -g hexo-cli 安装hexo
hexo init
npm install
npm install hexo-deployer-git

Git登陆

1
2
3
4
5
git config --global user.name "你的GitHub用户名"
git config --global user.email "你的GitHub注册邮箱"

ssh-keygen -t rsa -C "你的GitHub注册邮箱"
将公钥添加到GitHub

cmd - SOCKS5 代理设置

set http_proxy=socks5://127.0.0.1:7891
set https_proxy=socks5://127.0.0.1:7891

Git代理

git config –global http.proxy socks5://127.0.0.1:7891
git config –global https.proxy socks5://127.0.0.1:7891

HEXO上传到github

1
2
3
4
5
6
git add .
git commit -m "..."
git push

发布到GitHub:
hexo g -d

从GitHub恢复HEXO

1
2
从GitHub拉取:
git clone git@github.com:GitHubname/GitHubname.github.io.git
1
cd GitHubname.github.io.git

Git bash依次执行下列指令:

npm install hexo
npm install
npm install hexo-deployer-git