System info

  • Ubuntu 16.04
  • Git
  • Node

Todos

install nodeks and npm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 更新
sudo apt-get update
# 安装低版本的node,然后再升级最新
sudo apt-get install nodejs
sudo apt install nodejs-legacy
sudo apt install npm
#安装更新版本的工具N,执行:
sudo npm install n -g
#跟新node版本,执行:
sudo n stable
sudo node -v

# install hexo-cli
sudo npm install -g hexo-cli

install and config git

install hexo with npm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-(1) delete origiginal your own github.io repository
-(2) create the new one
-(3) git clone to local
-(4) hexo init <folder>, and move the contents into local github.io repository
-(5) move your own theme files and confg.yaml file to the proper location
-(6) install the node libs what your theme needs to satisfy

- for example, I use the indigo theme, I should run below commands
cd <github.io folder>
# 主题默认使用 less 作为 css 预处理工具。
npm install hexo-renderer-less --save
# 用于生成 rss。
npm install hexo-generator-feed --save
# 用于生成静态站点数据,用作站内搜索的数据源。
npm install hexo-generator-json-content --save
# 用于生成微信分享二维码。
npm install hexo-helper-qrcode --save
# error, hexo d后 ERROR Deployer not found: git
npm install --save hexo-deployer-git

write posts and deploy

1
2
3
4
5
6
hexo clean
hexo g
hexo s
hexo d

# only fit for me to update my own blog.

reference