背景:
将Hexo环境源码上传至github后,在新电脑(什么环境都未安装)上如何将Hexo环境复刻下来,重新开始写博客上传一、组件安装
1、git
1 | yum install -y git |
2、nodejs
1 | yum install -y nodejs |
3、npm
1 | yum install -y npm |
4、hexo-cli
1 | yum install -y hexo-cli |
二、环境复刻
1、将github上hexo源码分支clone至本地(我的分支名为hexo)
1 | git clone -b hexo https://github.com/Liang2L/liang2l.github.io.git |
2、依赖安装
1 | npm install |
== 备注 ==:在npm安装依赖时,可能会报错
1 | npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference |
此时将openssl更新即可
1 | yum update -y openssl |
3、安装git推送环境
1 | git config --global user.name "Liang2L" |
4、在github上settings中创建SSH,将获取的公钥复制进去即可
1 | //查看SSH是否创建成功 |
三、新环境上更新博客
1、将环境源码推送至hexo分支上
1 | git add . |
2、将生成的html静态文件推送至master分支上
1 | hexo g |
参考文档:
安装:https://blog.csdn.net/sinat_37781304/article/details/82729029
迁移:https://blog.csdn.net/White_Idiot/article/details/80685990