安装相关

安装Hexo

npm install -g hexo-cli

卸载Hexo

npm uninstall hexo-cli -g

写作相关

新建文章

hexo n "名字" == hexo new "名字"

新建一个名为”newpage”的页面,默认网址主页地址/newapge/

hexo n page newpage

生成静态文件

hexo g == hexo generate

发布文章

hexo d == hexo -deploy

启动本地服务器,预览地址:http://localhost:4000/

hexo s == hexo server

清理缓存文件和已生成的静态文件

hexo clean

组合使用

清理并开启本地预览服务

hexo clean && hexo s

清理并重新生成静态文件

hexo clean && hexo g

生成后立即部署网站

hexo g -d == hexo generate -d == hexo generate -deploy

系统命令

hexo --help

Commands:
  clean     Remove generated files and cache.
  config    Get or set configurations.
  deploy    Deploy your website.
  generate  Generate static files.
  help      Get help on a command.
  init      Create a new Hexo folder. # 初始化博客
  list      List the information of the site
  migrate   Migrate your site from other system to Hexo.
  new       Create a new post.
  publish   Moves a draft post from _drafts to _posts folder.
  render    Render files with renderer plugins.
  server    Start the server.
  version   Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD
  --debug   Display all verbose messages in the terminal
  --draft   Display draft posts
  --safe    Disable all plugins and scripts
  --silent  Hide output on console