mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
Create Comment.astro
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
// src/components/Comment.astro
|
||||
---
|
||||
|
||||
<div id="tcomment"></div>
|
||||
|
||||
<!-- 定义初始化函数 -->
|
||||
<script is:inline>
|
||||
function initTwikoo() {
|
||||
try {
|
||||
twikoo.init({
|
||||
envId: 'http://47.108.235.131:40063/', // 👈 替换成你自己的 Twikoo 环境 ID(如 https://xxx.vercel.app)
|
||||
el: '#tcomment',
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Twikoo 初始化失败:', e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 延迟加载 twikoo CDN,加载完成后自动初始化 -->
|
||||
<script is:inline defer src="https://cdn.jsdelivr.net/npm/twikoo@1/dist/twikoo.all.min.js" onload="initTwikoo()"></script>
|
||||
Reference in New Issue
Block a user