版本号 3.2.4 -> 3.2.5(修 Prism 报错,项目地址改为自建 Git)
## 修 Prism is not defined
首页控制台报 `Uncaught ReferenceError: Prism is not defined`,来源是
wp-editormd 插件(不是本主题):它在 Prism 脚本加载之前就无条件执行了
`Prism.plugins.autoloader.languages_path = "..."`。
线上页面里的真实顺序:
第 668 行 该赋值语句
第 695 行 prism-core.min.js
第 696 行 prism-autoloader.min.js
在 `wp_head` 优先级 0 垫一个最小空壳 `window.Prism`(含 plugins.autoloader
这条访问链路),让那句赋值有地方可写。已核对 prism-core.min.js 源码:它开头
只读 `u.Prism.manual` 与 `u.Prism.disableWorkerMessageHandler`,结尾
`global.Prism = Prism` 整体覆盖 —— 空壳必定被真实对象替换,不承担持久职责,
只为吸收那条过早的赋值。已用 jsdom 验证:去掉空壳重现原始报错,加上后消失,
且之后 `Prism.highlightAll` 仍可正常调用。
## 项目地址统一到 code.yangyq.net
原作者署名、原主题地址、README、语言包、JS 里的控制台横幅全部换成自建仓库地址。
LICENSE 文件保持原样不动(MIT 要求保留原始版权声明)。
## CDN 分支改成拿不到就回退本地
原来的 `g_cdn` 分支指向 `cdn.jsdelivr.net/gh/vtrois/kratos`,本仓库在自建
Gitea 上,jsDelivr 只认 github/npm/wordpress,实测该地址 404。现改为仅在
`YANG_THEME_CDN_REPO` 常量存在时才走 CDN,否则一律用
`get_template_directory_uri()`。留一个 404 的地址比留空更危险:页面能开、
样式全丢,极难排查。
## 顺带
- `.gitattributes` 补 `*.mo binary`:原来是靠"含 NUL"启发式判定,不是契约
- `update.json` 的版本号跟进到 3.2.5
- `kratos.min.js` / `kratos.min.css` 用压缩器重新生成,不手工改产物
This commit is contained in:
+8
-8
@@ -177,8 +177,8 @@ msgid "版权声明"
|
||||
msgstr "Copyright notice"
|
||||
|
||||
#: inc/options-framework/includes/class-options-interface.php:248
|
||||
msgid "主题源码使用 <a href=\"https://github.com/vtrois/kratos/blob/master/LICENSE\" target=\"_blank\">MIT 协议</a> 进行许可,说明文档使用 <a href=\"https://creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC BY-NC-ND 4.0</a> 进行许可。"
|
||||
msgstr "Theme source code licensed by <a href=\"https://github.com/vtrois/kratos/blob/master/LICENSE\" target=\"_blank\">MIT protocol</a> ,Instruction documents are licensed using <a href=\"https://creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC by-nc-nd 4.0</a>."
|
||||
msgid "主题源码使用 <a href=\"https://code.yangyq.net/laoyang/wordpress-kratos-yang/src/branch/main/LICENSE\" target=\"_blank\">MIT 协议</a> 进行许可,说明文档使用 <a href=\"https://creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC BY-NC-ND 4.0</a> 进行许可。"
|
||||
msgstr "Theme source code licensed by <a href=\"https://code.yangyq.net/laoyang/wordpress-kratos-yang/src/branch/main/LICENSE\" target=\"_blank\">MIT protocol</a> ,Instruction documents are licensed using <a href=\"https://creativecommons.org/licenses/by-nc-nd/4.0/\" target=\"_blank\">CC by-nc-nd 4.0</a>."
|
||||
|
||||
#: inc/options-framework/includes/class-options-interface.php:249
|
||||
msgid "打赏支持"
|
||||
@@ -1096,17 +1096,17 @@ msgid "Kratos"
|
||||
msgstr "Kratos"
|
||||
|
||||
#. Theme URI of the plugin/theme
|
||||
msgid "https://github.com/vtrois/kratos"
|
||||
msgstr "https://github.com/vtrois/kratos"
|
||||
msgid "https://code.yangyq.net/laoyang/wordpress-kratos-yang"
|
||||
msgstr "https://code.yangyq.net/laoyang/wordpress-kratos-yang"
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid "主题提供了多种针对自媒体博客需求的侧栏工具,删繁就简专注于用户的阅读体验,优化的邮件中心为你的网站留存加分添彩。"
|
||||
msgstr "Theme provides a variety of widgets to meet the needs of self-service media blogs. Focusing on a user-centric reading experience, an optimized email center adds extra points to your website retention."
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Seaton Jiang"
|
||||
msgstr "Seaton Jiang"
|
||||
msgid "Yongquan Yang"
|
||||
msgstr "Yongquan Yang"
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "https://www.vtrois.com/"
|
||||
msgstr "https://www.vtrois.com/"
|
||||
msgid "https://yangyq.net"
|
||||
msgstr "https://yangyq.net"
|
||||
|
||||
Reference in New Issue
Block a user