EvanNotFound / hexo-theme-redefine

Simplicity in Speed, Purity in Design. Redefine Your Hexo Journey.
https://redefine.ohevan.com
GNU General Public License v3.0
1.43k stars 118 forks source link

[BUG] 禁用了 CDN 后 waline.mjs 仍然走 CDN #247

Closed lolifamily closed 1 year ago

lolifamily commented 1 year ago

提交前检查单

Bug 描述 禁用了 CDN 后 waline.mjs 仍然走 CDN

cdn:
  enable: false
Muska-Ami commented 1 year ago

看了一下源码,好像是直接引入的,CDN这个配置仅限于主题的文件(srcdn 是我自己加的)

hexo.extend.helper.register("renderJS", function (path) {
  const _js = hexo.extend.helper.get("js").bind(hexo);
  const cdnProviders = {
    unpkg: "https://unpkg.com",
    jsdelivr: "https://cdn.jsdelivr.net/npm",
    srcdn: "https://jsd.onmicrosoft.cn/npm",
    aliyun: "https://evan.beee.top/projects",
    custom: this.theme.cdn.custom_url,
  };
// ...等共3段相关内容

评论系统引入相关

<script type="module"  <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>>
        import { init } from 'https://evan.beee.top/js/waline.mjs';

        function loadWaline() {
// ...
EvanNotFound commented 1 year ago

新版本已经更新/修复此功能,请前往更新 https://github.com/EvanNotFound/hexo-theme-redefine/releases