Upgrade to Hexo 3

I’ve use Hexo for a while and deply my blog on Github. Upgrade to Hexo 3 is extremely simple.

  1. Upgrade Hexo command line tool

    $ npm install hexo-cli -g
  2. Update your package.json

    • Basically replace old dependencies

      "dependencies": {
      - "hexo-renderer-ejs": "*",
      - "hexo-renderer-stylus": "*",
      - "hexo-renderer-marked": "*"
      + "hexo": "^3.0.0",
      + "hexo-generator-archive": "^0.1.0",
      + "hexo-generator-category": "^0.1.0",
      + "hexo-generator-index": "^0.1.0",
      + "hexo-generator-tag": "^0.1.0",
      + "hexo-renderer-ejs": "^0.1.0",
      + "hexo-renderer-marked": "^0.2.4",
      + "hexo-renderer-stylus": "^0.2.0",
      + "hexo-server": "^0.1.2"
      }
    • Add Hexo version This step is very important, your hexo cli wont work if you didn’t add this

      "hexo" : {
      "version" : 3.0.0
      }
  3. Update deployer settings

    • Install deployer first

      $ npm install hexo-deployer-git --save
    • Update deployer config

      - type: github
      - repository: [email protected]:ryanhanwu/ryanhanwu.github.io.git
      + type: git
      + repo: [email protected]:ryanhanwu/ryanhanwu.github.io.git

It’s done, happy blogging.