added ai评论
This commit is contained in:
1 parent
ec6f05539e
commit
0f7be7d270
152 files changed
+2323
-1277
No files matched your search
@@ -176,37 +176,8 @@ document.addEventListener("pjax:complete", function () {
|
||||
// 初始化代码复制
|
||||
initCodeCopy()
|
||||
// 重载评论
|
||||
if (document.querySelector("#Comments")) {
|
||||
var isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
// 默认配置作为后备
|
||||
var serverUrl = 'https://artalk.usj.cc';
|
||||
var siteName = '优世界';
|
||||
var emoticons = '/emotion/OwO.json';
|
||||
|
||||
// 尝试从 window.siteConfig 获取配置
|
||||
if (window.siteConfig && window.siteConfig.artalk) {
|
||||
serverUrl = window.siteConfig.artalk.server || serverUrl;
|
||||
siteName = window.siteConfig.artalk.site || siteName;
|
||||
emoticons = window.siteConfig.artalk.emoticons || emoticons;
|
||||
}
|
||||
|
||||
// 保存实例到全局变量 window.artalk
|
||||
window.artalk = Artalk.init({
|
||||
el: '#Comments', // 绑定元素的 Selector
|
||||
server: serverUrl, // 后端地址
|
||||
site: siteName, // 你的站点名
|
||||
// 使用全局变量或 DOM 读取 pageKey
|
||||
// 必须动态获取当前页面的 pid (RelPermalink)
|
||||
pageKey: document.getElementById('data-pid')?.textContent?.trim() || location.pathname,
|
||||
flatMode: true,
|
||||
darkMode: isDark,
|
||||
emoticons: emoticons
|
||||
})
|
||||
|
||||
// Artalk 初始化完成后,再加载弹幕
|
||||
if (!isMobile() && window.loadBarrager) {
|
||||
window.loadBarrager();
|
||||
}
|
||||
if (typeof window.initArtalk === 'function') {
|
||||
window.initArtalk();
|
||||
}
|
||||
// 重载不蒜子统计
|
||||
if (typeof window.bsz_fetch === 'function') {
|
||||
|
||||
Reference in new issue
Block a user