关于hexo的常用命令(备忘)
1761OTHERhexo2018-08-22

常用命令

官方文档

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ git clone '远程仓库' themes/ '本地文件名称'
hexo s 启动服务
hexo clean 清除缓存文件 (db.json) 和已生成的静态文件 (public)
hexo g 部署之前预先生成静态文件
hexo d 部署

hexo new <title> 新建一篇文章
hexo new draft <title> 新建一篇草稿
hexo publish <title> 将草稿移入posts文件夹

图片上传插件
npm install hexo-asset-image --save

代码上传到github所需要的依赖包
npm install hexo-deployer-git --save

hexo部署报错:The file will have its original line endings in your working directory.

  • 删除.deploy_git文件夹
  • 运行 git config –global core.autocrlf false
  • 正常流程 hexo clean / hexo g / hexo d