安装前提
- Node.js
- Git
安装Node.js
最好使用NVM进行安装
- curl安装NVM:
curl https://raw.github.com/creationix/nvm/master/install.sh | sh - wget安装NVM:
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh - NVM安装Node.js:
nvm install stable - 安装cnpm:
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装Hexo
cnpm install -g hexo-cli
初始化
- 初始化: `hexo init
; cd ; cnpm install - 新建文章:
hexo new [layout] <article> - 生成静态文件:
hexo generate或hexo g - 发布草稿:
hexo publish [layout] <filename> - 启动预览服务器:
hexo server, 默认情况下,访问 http://localhost:4000/ - 部署网站:
hexo deploy或hexo d
TODO
- 学习layout的三种布局:post,page,draft
- 写草稿文章,发布草稿(
hexo new draft <title>; hexo publish <title>)