搭建Hexo博客网站教程

Hexo 主页 Hexo. 文档 documentation. GitHub GitHub.

快速开始

创建博客页面

1
$ hexo new "My New Post"

更多信息: Writing

本地运行

1
$ hexo server

更多信息: Server

生成静态文件

1
$ hexo generate

更多信息: Generating

部署到远程站点

1
$ hexo deploy

更多信息: Deployment

GitHub部署

安装部署支持模块

1
$ npm install hexo-deployer-git --save

配置site config file: _config.yml

1
2
3
4
5
deploy:
type: git
repo: https://github.com/<username>/<project>
# example, https://github.com/hexojs/hexojs.github.io
branch: gh-pages

部署

1
2
3
hexo clean
hexo g
hexo d