Update Comment.astro

This commit is contained in:
2026-06-16 23:26:47 +08:00
committed by GitHub
parent a1733921d6
commit 9859bc6ad6
+11 -18
View File
@@ -9,25 +9,18 @@
<script is:inline>
function initTwikoo() {
if (window.tw) {
const el = document.getElementById('Comments');
if (el) el.innerHTML = '';
if (document.getElementById("Comments")) {
document.getElementById("Comments").innerHTML = "";
}
window.tw = null;
}
const el = document.getElementById('Comments');
if (!el) return;
try {
window.tw = twikoo.init({
el: '#Comments',
envId: 'http://47.108.235.131:40063/',
lang: 'zh-CN',
});
} catch (e) {
console.error('Twikoo 初始化失败:', e);
}
var tw = twikoo.init({
el: "#Comments",
envId: "http://47.108.235.131:40063/",
lang: "zh-CN",
});
window.tw = tw;
}
window.addEventListener('load', initTwikoo);
document.addEventListener('astro:page-load', initTwikoo);
window.addEventListener("load", initTwikoo);
document.addEventListener("astro:page-load", initTwikoo);
</script>