Upgrade Blog Theme

· 1 min read · 395 Words · -Views -Comments

I stayed on Hexo 3.x for a long time because upgrading theme‑next was a hassle. RSS errors turned out to be version‑related, so I bit the bullet and upgraded to simplify future maintenance.

这里简单描述下升级操作

Upgrade Hexo/NexT

  1. 删除next文件夹,之后执行下载新主题

    git clone https://github.com/theme-next/hexo-theme-next themes/next

  2. New NexT supports external config/custom styles outside the theme dir, making upgrades easier. Create next.yml and styles.styl in the project for customization.

    https://static.1991421.cn/2023/2023-06-03-133549.jpg

  3. 新主题支持Gitalk评论系统,索性也从Disqus切换过去,这样加载速度,访客体验会流畅些。

Gitalk integration

集成很简单

  1. 访问GitHub创建应用
  2. 获取Client ID,Client Secret,将这些信息包含仓库名称,GitHub账号填写在配置文件即可
    • 我这里将仓库指向我的博客,这样方便管理博客评论

Notes

  1. 地址/回调地址填写线上地址
  2. admin_user配置可以实现,如果是管理员用户访问,直接创建对应页面的issue
  3. 脚本会自动创建issue,且加上label【gitalk,及ID】

Final Thoughts

  1. 目前感觉新版hexo+theme提升了构建效率
  2. 新的配置方案支持自定义文件夹,有利于之后升级维护
Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover