在新的电脑上部署 Hexo,并保留原有博客的方法
- U盘拷贝整个blog文件夹。
- 在新的电脑上装好git并配置好用户名和密钥。
- 安装 node.js
- 安装 hexo:
npm install hexo-cli -g
- 用U盘把blog文件夹拷贝到新的电脑上。在新电脑上,在blog文件夹中打开终端,输入:
npm install
。注意,在创建一个新的博客的时候到这一步是hexo init
,而由于我们已经要继承之前的设置和博文,所以这一步不能输入hexo init
。 - 至此,完成移植。使用
hexo new
、hexo d -g
等指令测试是否成功吧。
Empty HTML hexo issue
降级 node 到 13 或者 12 。或者升级 hexo 到 4.2.1 及以上。
https://alanlee.fun/2021/02/28/hexo-empty-html/
为页面增加阅读次数
为页面添加密码阅读
https://github.com/D0n9X1n/hexo-blog-encrypt
新增新的 subdirectory 菜单
https://theme-next.iissnan.com/getting-started.html#menu-settings
翻页按钮显示不正常
翻页按钮不正常显示,显示为<i class="fa fa-angle-right"></i>
的HTML编码
https://www.cnblogs.com/xiejava/p/12456273.html
为博客添加搜索功能
https://github.com/theme-next/hexo-generator-searchdb
hexo d 遇到权限问题
报错:1
2
3
4
5ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
原因 Git SSH Key expired.
solution: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
Upgarde Hexo / Next
1 | $ hexo --version |
Next compatibility with Hexo version:
https://theme-next.js.org/docs/getting-started/upgrade
It’s recommended to upgrade NexT to version 8 to get the latest features and supports in the new Theme-Next repository. Which means it needs to upgrade hexo to 5.0 or later version first.
Run npm i hexo@5.4.2
,
1 | $ hexo --version |
升级过后测试 hexo -s 遇到一种乱码问题,通过下面方式解决:
https://blog.csdn.net/qq_39898645/article/details/109181736
Upgrade Next (not try)
check next version: go to next _config.yml in the theme next folder, go to the last line, see the version is 5.1.1
Follow this doc to upgrade:
https://theme-next.js.org/docs/getting-started/upgrade#Upgrade-from-Legacy-Version
npm install hexo-theme-next@8.14.2
- rename old next folder -> next-old, so that you can switch back to old version anytime.
- back up two folder /themes/next, /source/_data
- $ npm install hexo-theme-next@8.14.2
todo: https://github.com/theme-next/hexo-theme-next/blob/master/docs/INSTALLATION.md