Hexo环境搭建




准备工具

1. Node

2. Git

3. 了解hexo

安装Hexo

1. 执行命令安装

1
npm install -g hexo

2. 执行初始化命令

1
hexo init

3. 生成静态页面

1
2
3
$ hexo generate
//简写 hexo g

4. 启动本地服务

1
2
hexo server
//简写 hexo s

然后可以尝试访问http://localhost:4000,如果能访问,就成功了,不能访问…说明有问题,具体什么问题,可以提问


关联GitHub

1. 配置_config.yml文件

一般在文件末尾,把seeways换成你的用户名

1
2
3
4
5
6
# Deployment
deploy:
type: git
repo: git@github.com:seeways/seeways.github.io.git
branch: master


2. 部署到GitHub

hexo deploy


编写流程

你可以随便编写文档


1
2
hexo g
hexo d

推荐用github自带的 git shell,反正我用git bash提示我权限不足,不知道什么情况