jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
7.23k stars 1.3k forks source link

[Bug]: layout/includes/third-party/newest-comments/artalk.pug 中关于 avatarCdn 的插值语法有误 #1535

Closed mosuzi closed 3 months ago

mosuzi commented 3 months ago

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.13.0

是否修改过主题文件? || Has the theme files been modified?

是 (Yes)

使用的瀏覽器? || What browse are you using?

Chrome

使用的系統? || What operating system are you using?

Windows

依賴插件 | Package dependencies Information

hexo-site@0.0.0
├── @neilsustc/markdown-it-katex@0.6.1
├── cheerio@0.22.0
├── gulp-clean-css@4.3.0
├── gulp-html-minifier-terser@6.0.1
├── gulp-htmlclean@2.7.22
├── gulp-imagemin@7.1.0
├── gulp-terser@2.1.0
├── gulp@4.0.2
├── hexo-admin@2.3.0
├── hexo-blog-encrypt@3.1.9
├── hexo-butterfly-artitalk@1.0.4
├── hexo-deployer-git@3.0.0
├── hexo-filter-nofollow@2.0.2
├── hexo-generator-archive@1.0.0
├── hexo-generator-baidu-sitemap@0.1.9
├── hexo-generator-category@1.0.0
├── hexo-generator-feed@3.0.0
├── hexo-generator-index@2.0.0
├── hexo-generator-search@2.4.3
├── hexo-generator-sitemap@2.2.0
├── hexo-generator-tag@1.0.0
├── hexo-hide-posts@0.1.1
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-markdown-it@5.0.0
├── hexo-renderer-pug@1.0.0
├── hexo-renderer-stylus@2.1.0
├── hexo-server@2.0.0
├── hexo-theme-butterfly@4.13.0
├── hexo-theme-landscape@0.0.3
├── hexo-wordcount@6.0.1
└── hexo@5.4.2

問題描述 | Describe the bug

有问题的源码如图:

image

这里插值的结果直接将字符串内容替换到代码中,导致 js 在运行时报错,如下图

image

解决方案即在插值外再额外增加引号强制内容为字符串:

image

最终编译后会如图:

image

出現問題網站 | Website

通过 artalk 后端直接设置 gravatar.mirror 的方式,可以避免这个问题,所以暂时没有出现问题的网站

mosuzi commented 3 months ago

1536 可以修复这个问题