twikoojs / twikoo

💬 一个简洁、安全、免费的静态网站评论系统 | A simple, safe, free comment system.
http://twikoo.js.org
MIT License
1.4k stars 264 forks source link

Twikoo 评论系统的URL问题 #218

Open SekiBetu opened 2 years ago

SekiBetu commented 2 years ago

https://github.com/blinkfox/hexo-theme-matery/pull/610#issuecomment-897386985 image image 配置文件里如图填写后变成了这样的URL导致无法加载Twikoo 适配Twikoo时似乎只是叠加了配置文件里的路径而没有判断是否是在线链接

imaegoo commented 2 years ago

应该是 theme.jsDelivr.url 影响的

layout/_partial/twikoo.ejs

- <script src="<%- theme.jsDelivr.url %><%- url_for(theme.libs.js.twikoo) %>"></script>
+ <script src="<%- url_for(theme.libs.js.twikoo) %>"></script>

你可以改一下试试,有效就给原作者提交 PR

SekiBetu commented 2 years ago

应该是 theme.jsDelivr.url 影响的

layout/_partial/twikoo.ejs

- <script src="<%- theme.jsDelivr.url %><%- url_for(theme.libs.js.twikoo) %>"></script>
+ <script src="<%- url_for(theme.libs.js.twikoo) %>"></script>

你可以改一下试试,有效就给原作者提交 PR

image 有效

SekiBetu commented 2 years ago

我才发现发错地方了,原本是发给matery项目的,阴差阳错发到这里了

SekiBetu commented 2 years ago

应该是 theme.jsDelivr.url 影响的

layout/_partial/twikoo.ejs

- <script src="<%- theme.jsDelivr.url %><%- url_for(theme.libs.js.twikoo) %>"></script>
+ <script src="<%- url_for(theme.libs.js.twikoo) %>"></script>

你可以改一下试试,有效就给原作者提交 PR

这只是个临时解决方案吧,应该是要加判断的,不然普通人填了本地路径也会炸

imaegoo commented 2 years ago

是临时解决方案。

照这么说主题配置下的其他评论系统也存在这个问题,向主题作者反馈吧,统一修改。

<script src="<%- theme.jsDelivr.url %><%- url_for('/libs/valine/av-min.js') %>"></script>
<script src="<%- theme.jsDelivr.url %><%- url_for(theme.libs.js.valine) %>"></script>