info-hexo

HEXO - the Blog tool

[toc]

Base info and Installation

Website: https://hexo.io

Documentation: https://hexo.io/docs

Requirements of Installation:

  • Node.js
  • Git: sudo apt install git-core

Installation:

1
2
3
4
5
$ sudo npm install hexo-cli -g
$ hexo init blog
$ cd blog
$ sudo npm install
$ hexo server

After the above command, you should be able to see:

1
2
3
INFO Validating config
INFO Start processing
INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop

Using HEXO

Command: init

$ hexo init [folder]

This command initializes a website. If no folder is provided, Hexo will set up a website in the current directory.

Command: new

$ hexo new [layout] <title>

Create a new article. If no layout is provided, Hexo will use the default_layout from __config.yml. If the title contains spaces, surround it with quotation marks.

Options includes

  • -p, --path: Post path. Customize the path of the post.
  • -r, --replace: Replace the current post if existed.
  • -s, --slug: Post slug. Customize the URL of the post.

Command: generate

$ hexo generate

Generates stataic files

Options are

  • -d, --deploy: Deploy after generation finishes
  • -w, --watch: Watch file changes
  • -b, --bail: Raise an error if any unhandled exception is throw during generation
  • -f, --force: Force regenerate
  • -c, --concurrency: Maximum number of files to be generated in parallel. Default is infinity

Command: deploy

1
$ hexo deploy