Overview

Recently I want to build a static website since it could host on GitHub Pages. I found Hexo which is written by Node.js. Hexo could let you build your website very fast and it also supports Markdown for writting your webpage.

Installation

Theme

If you want to build your blog easily and quickly, you will need to leverage Hexo theme. Theme is a collection of css, js which could render your webpage.

There are many themes could be selected on Hexo/Theme. Following only two steps could build your website with theme:

  1. Create a new folder with entire files of theme under ./themes .
  2. Open ./_config.yml and update variable of theme: <theme>.

Build

  1. Initialize a website
    npx hexo init
  2. Create a new article
    npx hexo new <title>
  3. Generate static files
    npx hexo generate
  4. Start a server
    npx hexo server

Deploy

GitHub Pages

  1. Install hexo-deployer-git
  2. Update ./_config.yml
    1
    2
    3
    4
    deploy:
    type: git
    repo: https://github.com/<username>/<project>
    branch: <branch>
  3. Execute npx hexo clean && npx hexo deploy -g
  4. Launch <username>.github.io