Contents
  1. 1. Ubuntu 16.04
  2. 2. Mac
  3. 3. How to use hexo
    1. 3.1. Reference
  4. 4. How to setup with github(zjunweihit as example)
  5. 5. Reference

This document describes how to setup hexo on your system.

Ubuntu 16.04

  • Install nodejs

    1
    sudo apt-get install nodejs
  • Install npm

    1
    sudo apt-get install npm
  • Update the source for npm, appeding below to ~/.npmrc

    1
    registry = https://registry.npm.taobao.org
  • Install hexo, to show detail with --verbose

    • Run it with bash
      1
      2
      sudo ln -sf /usr/bin/nodejs /usr/bin/node
      sudo npm install --unsafe-perm -g hexo
  • Test hexo

    1
    hexo --help
  • Install hexo plugin

    1
    npm install hexo-deployer-git --save

Mac

  • Install nodejs and npm

  • Update the source for npm, appeding below to ~/.npmrc

    1
    registry = https://registry.npm.taobao.org
  • Install hexo

    1
    sudo npm install -g hexo
  • Test hexo

    1
    hexo --help
  • Install hexo git plugin

    1
    2
    cd folder where executes "hexo init"
    npm install hexo-deployer-git --save

How to use hexo

  • Initialization

    1
    hexo init
  • Create a new file

    1
    hexo n #new
  • Generate files

    1
    hexo g #generate
  • Start server to access locally, at localhost:4000 or <IP>:4000 at another PC

    1
    hexo s #server
  • Deploy to the git repo

    1
    hexo d #deploy

Reference

How to setup with github(zjunweihit as example)

  • Initialize blog

    1
    2
    3
    mkdir blog
    cd blog
    hexo init
  • Update files in root path

    1
    2
    3
    4
    git clone https://github.com/zjunweihit/hexo_root.git
    cp -a hexo_root/* ./
    cp -a hexo_root/.gitignore ./
    cp -a hexo_root/.git ./
  • Update the theme

    1
    2
    cd themes
    git clone https://github.com/zjunweihit/jacman.git

Reference

Contents
  1. 1. Ubuntu 16.04
  2. 2. Mac
  3. 3. How to use hexo
    1. 3.1. Reference
  4. 4. How to setup with github(zjunweihit as example)
  5. 5. Reference