更换新电脑后的操作
xgcd Lv2

环境准备

安装nodejs和npm
如果是Windows机器,安装nodejs时需要下载客户端安装:https://nodejs.cn/download/

添加SSH公钥

保存到远程的authorized_keys
验证公钥配置是否生效:
1.无密码登录Git: ssh -v git@xxx.x.xxx.xxx
2.或拉取远程仓库: git clone git@xxx.x.xxx.xxx:/usr/repo/xgcd.git

安装hexo插件,初始化站点及发布插件

进入I:\xiguanchendian目录 Git Bash Here:
npm install -g hexo-cli hexo-server
hexo init xgcd
npm install hexo-deployer-git –save

复制原电脑上的数据到新电脑

(原文链接:https://blog.csdn.net/qq_43698421/article/details/120407042)
需要复制的
_config.yml:站点配置
package.json:说明使用那些包
scaffolds:文章的模板
source:自己写的博客文件
themes:主题(关键是—_config的配置文件)
.gitignore:限定在提交的时候哪些文件可以忽略

需要删除的
.git:无论是在站点根目录下,还是主题目录下的.git文件,都可以删掉。
node_modules:在用npm install会重新生成
public:hexo g会重新生成
.deploy_git:在使用hexo d时也会重新生成
db.json文件
其实上面这些文件也就是.gitignore文件里面记载的可以忽略的内容。

预览/发布

hexo三连: hexo clean ,
hexo s 访问localhost:4000预览
hexo g 生成静态文件
hexo d 发布到远程git

更换主题:

Keep主题:
git clone https://github.com/XPoet/hexo-theme-keep.git
https://keep-docs.xpoet.cn/tutorial/configuration-guide/footer.html

Keep主题使用指南只需要这一篇就够了: https://keep-docs.xpoet.cn/
评论模块:LeanCloud
https://console.leancloud.cn/login?from=%2Fapps
https://waline.js.org/guide/get-started/

其他

备案完成后: https://cloud.tencent.com/document/product/243/61412
京ICP备2022006010号-2

从0到1

https://www.glimound.com/build-hexo-blog/

 Comments
Comment plugin failed to load
Loading comment plugin