Hexo学习笔记--常用命令及部署步骤

参考资料:

Hexo搭建Github静态博客:http://www.cnblogs.com/zhcncn/p/4097881.html
Hexo:独立博客新玩法:http://www.aips.me/hexo-independent-blog-new-ways.html
Hexo 简明入门教程:http://www.tuicool.com/articles/AB7zeu
更换博客系统-从jekyll到hexo:http://segmentfault.com/a/1190000002398039

 

Hexo部署步骤

npm install
npm install hexo-deployer-git --save
hexo new "新页面"
hexo clean
hexo generate

hexo deploy

 

Hexo常用命令

hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #将.deploy目录部署到GitHub
hexo help # 查看帮助
hexo version #查看Hexo的版本

复合命令

hexo deploy -g #生成加部署
hexo server -g #生成加预览

命令的简写为:

hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy

 

_config.yml需要修改的地方:

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
type: git
repository: git@github.com:your-name/your-name.github.io.git
branch: master

 

注意:hexo deploy时可能出现的错误

ERROR Deployer not found: github

解决方法:

npm install hexo-deployer-git --save 改了之后执行,

hexo 更新到3.0之后,deploy的type 的github需要改成git

 

Hexo实现rss订阅支持:

要实现订阅,只需要使用hexo-generator-feed插件即可。插件的安装卸载需要一条命令即可,详细的插件列表可以看Plugins

这里使用 npm install hexo-generator-feed --save

 http://ibruce.info/2013/11/22/hexo-your-blog/

 http://twiceyuan.com/

HEXO 添加多说

http://blog.csdn.net/wizardforcel/article/details/40707993

原文地址:https://www.cnblogs.com/gnivor/p/4467006.html