建立一篇新的文章。 如果沒有設定 layout 的話,則會使用 _config.yml 中的 default_layout 設定代替。 Use the layout draft to create a draft. If the title contains spaces, surround it with quotation marks.
選項
描述
-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.
By default, Hexo will use the title to define the path of the file. For pages, it will create a directory of that name and an index.md file in it. Use the --path option to override that behaviour and define the file path:
hexo new page --path about/me "About me"
will create source/about/me.md file with the title “About me” set in the front matter.
Please note that the title is mandatory. For example, this will not result in the behaviour you might expect:
hexo new page --path about/me
will create the post source/_posts/about/me.md with the title “page” in the front matter. This is because there is only one argument (page) and the default layout is post.
generate
$ hexo generate
Generates static files.
選項
描述
-d, --deploy
Deploy after generation finishes
-w, --watch
Watch file changes
-b, --bail
Raise an error if any unhandled exception is thrown during generation
-f, --force
Force regenerate
-c, --concurrency
Maximum number of files to be generated in parallel. Default is infinity
publish
$ hexo publish [layout] <filename>
發表草稿。
server
$ hexo server
Starts a local server. By default, this is at http://localhost:4000/.
Lists the configuration (_config.yml). If key is specified, only the value of the corresponding key in the configuration is shown; if both key and value are specified, the value of the corresponding key in the configuration is changed to value.
選項
安全模式
$ hexo --safe
Disables loading plugins and scripts. Try this if you encounter problems after installing a new plugin.
除錯模式
$ hexo --debug
在終端機中顯示除錯訊息並儲存記錄檔到 debug.log。 Try this if you encounter any problems with Hexo. 當您碰到問題時,試著以除錯模式重新執行一次,並 把除錯訊息貼到 GitHub。