Now we can use hexo,github and your domain to make a site like here.
You must prepare something:

  • hexo
  • github account
  • your domain

Use Hexo

  1. Install node
    hexo used node so we must install node before all,I use homebrew in Mac:

    1
    brew install node
  2. Create blog folder and install hexo :

    1
    2
    3
    mkdir blog
    cd blog
    npm install hexo-cli -g
  3. Test hexo :

    1
    hexo server

then you can visit http://localhost:4000 to see your hexo blog
all config info in _config.yml

Use github domain mapping your blog

now we will use usename.github.io domain mapping your blog

  1. create your io repository
    create it and the repository name must be user_name.github.io,user_name is your github user name
    like me https://github.com/BestBurning so my user name is BestBurning and my io domain repo is BestBurning.github.io
  2. mapping your local blog
    change _config.yml
    1
    vi _config.yml

at the bottom,you can find deploy,make it like

1
2
3
4
deploy:
type: git
repo: https://github.com/BestBurning/BestBurning.github.io.git
branch: master

save and exec command

1
2
npm install hexo-deployer-git --save
hexo deploy

then you can visit your io domain like bestburning.github.io

Mapping your own domain to github.io domain

diyishuai.cn is my domain , and if you visit it will redirect to bestburning.github.io

  1. Use your domain analyze to your user_name.github.io
    • add CNAME with www to point user_name.github.io
    • add A with @ to point io domian ip
  2. at blog/soruce folder ,touch file named CNAME
    1
    vi blog/CNAME

add your domain to it

1
diyishuai.cn

deploy it

1
hexo deploy

  1. then you can visit diyishuai.cn to visit your blog

hexo have some themes you can select it ,good luck!