博客迁移工作

重新整理的最新适合我的迁移博客的方法,说实话我想自己写一个软件来快速操作…

安装hexo

参考文档:(下文来源文章)

https://blog.csdn.net/qq_36759224/article/details/82121420

主要的命令:

外文件夹,例如:GithubBlog

1
2
npm install hexo-cli -g  
npm install hexo-deployer-git --save

新建Hexo之后,在Hexo文件夹里面:

1
hexo init

配置 SSH,外文件夹

这里以我自己的邮箱为例。

1
ssh-keygen -t rsa -C "3049564188@qq.com"

直接回车

1
2
3
Generating public/private rsa key pair.  
Enter file in which to save the key (/c/Users/you/.ssh/id_rsa):
//到这里可以直接回车将密钥按默认文件进行存储
1
2
3
Enter passphrase (empty for no passphrase):  
//这里是要你输入密码,其实不需要输什么密码,直接回车就行
Enter same passphrase again:
1
2
3
4
5
6
Your identification has been saved in /c/Users/you/.ssh/id_rsa.  
Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub.
The key fingerprint is:
这里是各种字母数字组成的字符串,结尾是你的邮箱
The key's randomart image is:
这里也是各种字母数字符号组成的字符串

运行以下命令,将公钥的内容复制到系统粘贴板上

1
clip < ~/.ssh/id_rsa.pub

测试:

1
ssh -T git@github.com
1
ssh -T git@gitee.com

配置 Git 个人信息

1
2
git config --global user.name "3049564188@qq.com"  
git config --global user.email "3049564188@qq.com"

站点配置文件中:

1
2
3
4
5
deploy:
- type: git
repository:
github: git@github.com:Caijiyang/Caijiyang.github.io.git
branch: master

我的主题所需要的插件

查看所有插件及版本

1
npm ls -dept 0

全部安装

1
npm install hexo-renderer-pug hexo-renderer-stylus hexo-generator-sitemap hexo-generator-json-content hexo-generator-feed hexo-filter-github-emojis hexo-autonofollow  hexo-directory-category hexo-generator-searchdb  hexo-deployer-git --save