Commands
init
|
Initializes a website. If no folder
is provided, Hexo will set up the website in the current directory.
new
|
Creates 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.
generate
|
Generates static files.
Option | Description |
---|---|
-d , --deploy |
Deploy after generation finishes |
-w , --watch |
Watch file changes |
publish
|
Publishes a draft.
server
|
Starts a local server. By default, this is at http://localhost:4000/
.
Option | Description |
---|---|
-p , --port |
Override default port |
-s , --static |
Only serve static files |
-l , --log |
Enable logger. Override logger format. |
deploy
|
Deploys your website.
Option | Description |
---|---|
-g , --generate |
Generate before deployment |
render
|
Renders files.
Option | Description |
---|---|
-o , --output |
Output destination |
migrate
|
Migrates content from other blog systems.
clean
|
Cleans the cache file (db.json
) and generated files (public
).
list
|
Lists all routes.
version
|
Displays version information.
Options
Safe mode
|
Disables loading plugins and scripts. Try this if you encounter problems after installing a new plugin.
Debug mode
|
Logs verbose messages to the terminal and to debug.log
. Try this if you encounter any problems with Hexo. If you see errors, please raise a GitHub issue.
Silent mode
|
Silences output to the terminal.
Customize config file path
|
Uses a custom config file (instead of _config.yml
). Also accepts a comma-separated list (no spaces) of JSON or YAML config files that will combine the files into a single _multiconfig.yml
.
|
Display drafts
|
Displays draft posts (stored in the source/_drafts
folder).
Customize CWD
|
Customizes the path of current working directory.