mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Update Comment.astro
This commit is contained in:
@@ -9,25 +9,18 @@
|
|||||||
<script is:inline>
|
<script is:inline>
|
||||||
function initTwikoo() {
|
function initTwikoo() {
|
||||||
if (window.tw) {
|
if (window.tw) {
|
||||||
const el = document.getElementById('Comments');
|
if (document.getElementById("Comments")) {
|
||||||
if (el) el.innerHTML = '';
|
document.getElementById("Comments").innerHTML = "";
|
||||||
|
}
|
||||||
window.tw = null;
|
window.tw = null;
|
||||||
}
|
}
|
||||||
|
var tw = twikoo.init({
|
||||||
const el = document.getElementById('Comments');
|
el: "#Comments",
|
||||||
if (!el) return;
|
envId: "http://47.108.235.131:40063/",
|
||||||
|
lang: "zh-CN",
|
||||||
try {
|
|
||||||
window.tw = twikoo.init({
|
|
||||||
el: '#Comments',
|
|
||||||
envId: 'http://47.108.235.131:40063/',
|
|
||||||
lang: 'zh-CN',
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
window.tw = tw;
|
||||||
console.error('Twikoo 初始化失败:', e);
|
|
||||||
}
|
}
|
||||||
}
|
window.addEventListener("load", initTwikoo);
|
||||||
|
document.addEventListener("astro:page-load", initTwikoo);
|
||||||
window.addEventListener('load', initTwikoo);
|
|
||||||
document.addEventListener('astro:page-load', initTwikoo);
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user