Deploy HEXO to Github
1 min readJan 11, 2016
What is Hexo?
Hexo is a fast, simple and powerful blog framework. You write posts in Markdown (or other languages) and Hexo generates static files with a beautiful theme in seconds.
Installation
It only takes few minutes to set up Hexo.
Requirements
Install Hexo with npm:
$ sudo npm install -g hexo-cli
You can verify hexo is installed correctly.
$ hexo
Setup
$ hexo init blog$ cd blog$ npm install
Generates static files.
$ hexo g
Deployment
Before your first deployment, you will have to modify some settings in `_config.yml`.
Git
Install hexo-deployer-git.
$ npm install hexo-deployer-git --save
Edit _config.yml
deploy:
type: git
repo: git@github.com:yourname/yourRepo.git
branch: gh-pages# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://xxx.github.io/blog
root: /blog/
Generating SSH keys
Setting your username&email in Git
$ git config --global user.name "your name"
$ git config --global user.email "your_email@example.com"
Now, you may go~~
$ hexo d
If you just want to view your blog in local.
$ hexo s