Hexo搭建个人博客

安装hexo

需要先安装Node.js和Git
通过nvm安装Node.js
1
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh
1
$ nvm install stable
通过brew安装Git
1
$ brew install git

通过npm安装hexo

1
$ npm install -g hexo-cli

建站Hexo

1
2
3
$ hexo init <文件名>
$ cd <文件名>
$ npm install
1
2
3
4
5
6
7
8
.
_config.yml 配置信息
package.json
scaffolds 模板
source 资源文件
_draft 草稿
_posts 发布
themes 主题

使用说明

启动服务

1
$ hexo s

创建文章方式

新建文章

1
$ hexo new "文章名"

创建草稿

1
$ hexo new draft "文章名"

发布草稿

1
$ hexo publish "文章名"

发布文章

清除缓存和静态页面
1
$ hexo clean
生成静态页面
1
hexo generate 简写:hexo g
配置
1
$ hexo deploy 简写:hexo d

部署

hexo官方文档

创建标签和分类

开启评论