Tutorial for Hexo+Github=Blog

  1. Create repository

    Follow instructions in github to create a new repository

  1. Install npm

Follow instructions in npmjs

  1. Install Hexo

$ npm install hexo-cli -g

  1. Create a new directory and initialize

$ hexo init blog

$ cd blog

$ npm install

  1. Copy blog in blog\source\_posts

  2. Generate static website

$ hexo generate

  1. Configure deployed repository in __config.yml

$ vim __config.yml

1
2
3
4
5
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:USERNAME/USERNAME.github.io.git
  1. Install hexo-deployer-git

$ npm install hexo-deployer-git -save

  1. Deploy

$ hexo deploy

Now, you can access your blog through USERNAME.github.io.

Hexo is used to generate static website. Github is used as web server.

$ npm install hexo-generator-feed –save

$ vim __config.yml

1
2
3
4
5
6
7
8
9
feed:
type: atom
path: atom.xml
limit: 20
hub:
content:
content_limit: 140
content_limit_delim: ' '
order_by: -date
  • Change Theme

$ git clone THEME_URL themes/THEME_NAME

$ vim __config.yml

1
2
3
...
theme: THEME_NAME
...

Recommended Posts