閱讀目錄:html
[root@localhost ~]# wget https://nodejs.org/download/release/v6.14.1/node-v6.14.1-linux-x64.tar.gz
[root@localhost ~]# tar -zxvf node-v6.14.1-linux-x64.tar.gz -C /usr/local/
[root@localhost ~]# vim /etc/profile 添加 export NODE_HOME=/usr/local/node-v6.14.1-linux-x64 export PATH=$NODE_HOME/bin:$PATH
[root@localhost ~]# source /etc/profile
[root@localhost ~]# mkdir /hexo [root@localhost ~]# cd /hexo
[root@localhost hexo]# npm install -g hexo
[root@localhost hexo]# hexo init
[root@localhost hexo]# hexo generate
[root@localhost hexo]# npm install --save hexo-deployer-git
[root@localhost hexo]# vim _config.ymlnode
# Site title: louboboooの博客 subtitle: 記錄學習的技能和遇到的問題 description: 記錄學習的技能和遇到的問題 keywords: author: loubobooo language: zh-CN timezone: # URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url: https://loubobooo.com theme: maupassant # Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: https://gitee.com/loubobooo/hexo.git branch: master
[root@localhost hexo]# npm install --save hexo-admin [root@localhost hexo]# hexo server -d &
登陸hexo後臺頁面
在瀏覽器中輸入「http://localhost:4000/admin」linux
產生後臺加密後的密碼git
[root@localhost hexo]# node > const bcrypt = require('bcrypt-nodejs') > bcrypt.hashSync('your password secret here!') => '$2a$10$8f0CO288aEgpb0BQk0mAEOIDwPS.s6nl703xL6PLTVzM.758x8xsi'
[root@localhost hexo]# vim _config.yml
admin: username: hexo password_hash: be121740bf988b2225a313fa1f107ca1 secret: a secret something
[root@localhost hexo]# npm install hexo-generator-feed --save
[root@localhost hexo]# npm install hexo-generator-searchdb --save
[root@localhost hexo]# npm i -S hexo-helper-qrcode
[root@localhost hexo]# npm i --save hexo-wordcount
hexo new "文章名稱"算法
hexo new page "about"npm
hexo deployvim
hexo server &瀏覽器