From af491dac12e931027d9eaf1f37cef75628b8d53c Mon Sep 17 00:00:00 2001 From: Vaica <94612053+zqlit@users.noreply.github.com> Date: Sat, 24 Jan 2026 17:08:10 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E8=AF=84=E8=AE=BA=E5=8C=BA=E5=A4=9C?= =?UTF-8?q?=E9=97=B4=E6=A8=A1=E5=BC=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Ying/assets/js/mypjax.js | 20 +- themes/Ying/layouts/_default/tiaozhuan.html | 350 +++++++++++++------- 2 files changed, 249 insertions(+), 121 deletions(-) diff --git a/themes/Ying/assets/js/mypjax.js b/themes/Ying/assets/js/mypjax.js index 60109f1b..db6b19a5 100644 --- a/themes/Ying/assets/js/mypjax.js +++ b/themes/Ying/assets/js/mypjax.js @@ -177,15 +177,29 @@ 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; + } + Artalk.init({ el: '#Comments', // 绑定元素的 Selector - server: 'https://artalk.usj.cc', // 后端地址 - site: '优世界', // 你的站点名 + server: serverUrl, // 后端地址 + site: siteName, // 你的站点名 // 使用全局变量或 DOM 读取 pageKey // 必须动态获取当前页面的 pid (RelPermalink) pageKey: document.getElementById('data-pid')?.textContent?.trim() || location.pathname, flatMode: true, - emoticons: '/emotion/OwO.json' + darkMode: isDark, + emoticons: emoticons }) } // 重载评论弹幕 diff --git a/themes/Ying/layouts/_default/tiaozhuan.html b/themes/Ying/layouts/_default/tiaozhuan.html index 51d696b1..57052bc2 100644 --- a/themes/Ying/layouts/_default/tiaozhuan.html +++ b/themes/Ying/layouts/_default/tiaozhuan.html @@ -5,156 +5,270 @@ +
+
+ 你访问的网站可能包含未知的安全风险,如需继续访问,请手动复制链接访问,并注意保护帐号和隐私信息
-+ 您正在尝试访问一个外部链接。请注意,外部网站可能包含未知的安全风险,请确保您信任该站点。 +
+ +