准备源文件
可以备份到github或者coding,或者使用云盘同步(例如坚果云)。
环境准备
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| # sudo apt install npm
# sudo apt install -g hexo-cli
# git clone user@github.com/repo/
#
# npm install hexo-deployer-git --save
# npm install hexo-generator-feed --save
# npm install hexo-generator-sitemap --save
# npm install hexo-server --save
# $ npm install hexo-generator-archive --save
# npm install hexo-generator-searchdb --save
|
发布
1 2 3 4
| hexo clean # hexo s hexo g -d
|
问题排查
遇到一个问题:生成后访问 http://localhost:4000 出现白版和”Cannot GET /“,”/“是因为在public 目录下少了index.html文件,再次生成还是无效后,确认是少了组件:
1
| npm install hexo-generator-index
|
参见:【完美解决】Hexo博客出现“Cannot GET/xxx”错误
吐槽一下coding和腾讯云之间的账号互通问题,一阵瞎引导,竟然创建了一个新账号,以前的项目找不回来,两个网站之间来回绕了几遍,无意间又用邮箱登录上去了,之前都是能自动跳转登录的,现在还强制绑定微信和手机号,无语。