Hexo Usage

The common commands of Hexo.

1. init website

1
$ hexo init [folder]

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

2.1 create a new article

1
$ hexo new "article"

2.2 create a new page

1
$ hexo new page "page"

3. Generate static files

1
$ hexo generate
1
$ hexo g

4. Start local server

1
$ hexo server
1
$ hexo s

By default, It is at http://localhost:4000/.

5. Deploy to remote website

1
$ hexo deploy
1
$ hexo d

6. Clean the file

1
$ hexo clean

It will clean the cache file (db.json) and generated files (public directory).

7. The draft

7.1 create a new draft

1
$ hexo new draft "draft"

7.2 publish the draft

Moves a draft post from _drafts to _posts folder.

1
$ hexo publish [layout] <draft-filename>

7.3 Start the server and preview drafts

1
$ hexo server --drafts