# Shoka 升级

玩 blog 开始就用的 Shoka, 一直都没管主题,今天偶然发现别人的 Shoka 和我的长得有点区别,看页脚,ShokaX, 诶诶,居然有 ShokaX,
随后检索,发现原来 Shoka 已经停更了三年了
看了一下 ShokaX, 感觉优化了不少东西,直接升呗


npm -g install shokax-cli
SXC install shokaX -pm npm

# [SXEC 102] Critical rendering plugins are missing or incorrectly configured.

此代码代表包安装不完整,关键插件未安装,可能导致显示错误和性能下降等问题。
重新执行一下

SXC install shokaX

# [SXEC 201] Essential information(title, desc, lang, etc) config incorrectly, Page will render incorrectly

Hexo 配置中的关键信息缺失,包括站点标题、站点描述、站点语言、站点时区和站点 URL。

# 代码块样式也变了

看了一下官方,原来大家都遇到过这个问题
https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/243

# github 的 deploy 报错

  hexo clean
  hexo generate
  shell: /usr/bin/bash -e {0}
INFO  Validating config
INFO  Validating config
INFO  Start processing
Prism's Diff Highlight plugin requires the Diff language definition (prism-diff.js).Make sure the language definition is loaded or use Prism's Autoloader plugin.
WARN  The the WebP converter can not run correctly when you run hexo g after hexo cl, please run the hexo g again
INFO  Files loaded in 1.46 s
node:internal/deps/undici/undici:12502
      Error.captureStackTrace(err, this);
            ^

TypeError: fetch failed
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [cause]: AggregateError [ETIMEDOUT]: 
      at internalConnectMultiple (node:net:1117:18)
      at internalConnectMultiple (node:net:1185:5)
      at Timeout.internalConnectMultipleTimeout (node:net:1711:5)
      at listOnTimeout (node:internal/timers:575:11)
      at process.processTimers (node:internal/timers:514:7) {
    code: 'ETIMEDOUT',
    [errors]: [
      Error: connect ETIMEDOUT 116.253.29.204:443
          at createConnectionError (node:net:1647:14)
          at Timeout.internalConnectMultipleTimeout (node:net:1706:38)
          at listOnTimeout (node:internal/timers:575:11)
          at process.processTimers (node:internal/timers:514:7) {
        errno: -110,
        code: 'ETIMEDOUT',
        syscall: 'connect',
        address: '116.253.29.204',
        port: 443
      },
      Error: connect ENETUNREACH 2409:8c34:2220:b:3::3fb:443 - Local (:::0)
          at internalConnectMultiple (node:net:1181:16)
          at Timeout.internalConnectMultipleTimeout (node:net:1711:5)
          at listOnTimeout (node:internal/timers:575:11)
          at process.processTimers (node:internal/timers:514:7) {
        errno: -101,
        code: 'ENETUNREACH',
        syscall: 'connect',
        address: '2409:8c34:2220:b:3::3fb',
        port: 443
      }
    ]
  }
}

Node.js v20.13.1
Error: Process completed with exit code 1.

虽然不懂 nodejs, 但是看日志报错,是连接失败,推断是代理,github 用的是 node 默认的镜像源
本地的镜像源: https://registry.npmmirror.com (我挂了代理)
github 默认: https://registry.npmjs.org/
所以直接在报错的命令那里加了一个切换镜像源的命令

    - name: 切换代理
      run: |
        npm config get registry
        npm config set registry http://registry.npm.taobao.com

    - name: 生成静态文件
      run: |
        hexo clean
        hexo generate

# 大标题失效 alternate

_config.shokaX.yml 中 alternate 失效
本地可以,但是 github 上却还是显示为

可能是你的主题配置文件名称的问题
_config.shokaX.yml 改为_config.shokax.yml
本地是 windows, 而服务器是 linux

# 体验