準備
1、 一臺主機
我的是阿里雲(CentOS系統)
2、 node.js
可以參照我這篇文章搭建環境
https://segmentfault.com/a/11...
3、 git
安裝後查看版本正常輸出代表安裝成功
$ sudo yum install git-core
$ git --version
git version 1.8.3.1
Hexo 安裝
$ npm install -g hexo-cli
$ hexo version
hexo-cli: 1.1.0
os: Linux 3.10.0-693.2.2.el7.x86_64 linux x64
http_parser: 2.7.0
node: 9.3.0
v8: 6.2.414.46-node.15
uv: 1.18.0
zlib: 1.2.11
ares: 1.13.0
modules: 59
nghttp2: 1.25.0
openssl: 1.0.2n
icu: 60.1
unicode: 10.0
cldr: 32.0
tz: 2017c
新建博客
1、 建立文件夾
$ hexo init blog
2、安裝
$ cd blog
$ npm install
3、 生成靜態頁面
$ hexo g
4、 啓動hexo博客
$ hexo s
更換hexo主題
1、 下載next主題
$ cd /home/blog/theme
$ git clone https://github.com/iissnan/hexo-theme-next themes/next
2、 配置hexo主題(_config.yml)
主要是配置theme選項,其他配置可以自行參考hexo官網
theme: hexo-theme-next
更換主題後重新生成靜態文件然後啓動
$ hexo g
$ hexo s