1.Hexo博客部署

安装git

1
yum install git -y

安装node.js

1
yum install npm -y

安装Hexo

1
npm install -g hexo

安装hexo-deployer-git

1
npm install hexo-deployer-git --save

使用Hexo

创建Hexo工作目录,初始化Hexo

1
2
3
mkdir hexodir
cd hexodir/
hexo init

生成静态网页,在hexo工作目录内执行

1
hexo g

发布博文,在hexo工作目录内执行

1
hexo d

部署到github

修改hexo工作目录的_config.yml文件

1
2
3
4
5
6
7
8
9
10
11
12
deploy:
type: git
repository: https://github.com/yourname/yourname.github.io.git
branch: master

# or this:
deploy:
type: git
message: [message]
repo:
github: <repository url>,[branch]
gitcafe: <repository url>,[branch]

编写新博文

1
hexo new post "博文标题"

新建的博文目录hexodir/source/_posts/,使用markdown格式编写。

更多使用技巧

Hexo搭建Github静态博客