Tired of searching for how to install hexo every time when I reinstall the operation system, I just collect all these configuration tips here

Setting the username and useremail

1
2
$ git config --global user.name "Your Name"  
$ git config --global user.email "email@example.com"

Generate key

1
$ ssh-keygen -t rsa -C "email@example.com"

SSH keys check

1
$ ssh -T git@github.com

Install Hexo

Initialization and Installation

1
2
3
4
5
npm install hexo --save

hexo init
npm install
npm install hexo-deployer-git --save

Viewing Locally

1
hexo server

Sync it to GitHub

Generate the public folder

Run cmd or git bash and cd to the path of your blog and …

1
hexo g

Modify your _config.yml file

1
2
3
4
5
deploy: 
type: git
repository:
github: git@github.com:yelangya3826850/yelangya3826850.github.io.git,master
gitcafe: git@github.com:yelangya3826850/yelangya3826850.git,gitcafe-pages

Notice: You can put your blog in either master branch or gh-pages branch of github, but you can only put it in gh-pages branch of gitcafe. Just pick whichever you like …

At last, please type

1
hexo d

and if uploading successfully , you’ll get some messages.
If you get an error message saying: ERROR Deployer not found: git
you should reinstall the hexo-deployer-git. Just type

1
$ npm install hexo-deployer-git --save

Abbreviation of the Hexo commands

1
2
3
hexo n   ## new
hexo g ## generate
hexo s ## server

Themes of Hexo

Offcial Themes
Wixo

Git Tutorial of Liaoxue feng
一键部署到github与gitcafe
Hexo 服务器端布署及 Dropbox 同步