Hexo安装及常用命令使用

HEXO_3.png

Hexo 安装

  1. npm install hexo -g #安装
  2. npm update hexo -g #升级
  3. npm init #初始化

启动服务

hexo s #启动服务预览并自动更新,无需重启服务器

其他命令

1.hexo server -s #静态模式
2.hexo server -p 5000 #更改端口
3.hexo server -i 192.168.1.1 #自定义IP
4.hexo clean #清理缓存
5.hexo g #生成静态网页
6.hexo d #开始部署

7.hexo g -d #生成静态网页并部署,两步并一步

草稿

hexo publish [layout]

模版

  1. hexo new “postName” #新建文章
  2. hexo new page “pageName” #新建页面
  3. hexo server #启动服务预览
  4. hexo generate #生成静态页面
  5. hexo deploy #部署

简写

  1. hexo n “我的博客” == hexo new “我的博客” #新建文章
  2. hexo g == hexo generate #生成
  3. hexo s == hexo server #启动服务预览
  4. hexo d == hexo deploy #部署

设置文章摘要

more.png

报错处理

error:ERROR Deployer not found: git

处理:npm install hexo-deployer-git –save

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容