title: hexo常用命令
date: 2017-10-30 09:59:03
tags: hexo 教程
本文介绍hexo的常用命令。
hexo
npm install hexo -g #安装
npm update hexo -g #升级
npm init #初始化
服务器
hexo s #启动服务预览并自动更新,无需重启服务器
hexo server -s #静态模式
hexo server -p 5000 #更改端口
hexo server -i 192.168.1.1 #自定义IP
hexo clean #清理缓存
hexo g #生成静态网页
hexo d #开始部署
hexo g -d #生成静态网页并部署,两步并一步
草稿
hexo publish [layout]
模版
hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo server #启动服务预览
hexo generate #生成静态页面
hexo deploy #部署
简写
hexo n "我的博客" == hexo new "我的博客" #新建文章
hexo g == hexo generate #生成
hexo s == hexo server #启动服务预览
hexo d == hexo deploy #部署
设置文章摘要

报错
error:ERROR Deployer not found: git
解决方法
npm install hexo-deployer-git --save
网友评论