Update Body.tsx

This commit is contained in:
enneaa 2025-03-27 11:13:46 +08:00 committed by GitHub
parent 5dd2712794
commit e0a374aeff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,18 @@ import clipboardStyle from "./styles/clipboard.scss"
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
const Body: QuartzComponent = ({ children }: QuartzComponentProps) => { const Body: QuartzComponent = ({ children }: QuartzComponentProps) => {
return <div id="quartz-body">{children}</div> return
<div id="quartz-body">{children}
<div id="tcomment"></div>
<script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.41/dist/twikoo.min.js"></script>
<script>
twikoo.init({
envId: 'https://enneatwikoo.netlify.app/.netlify/functions/twikoo', // 腾讯云环境填 envIdVercel 环境填地址https://xxx.vercel.app
el: '#tcomment', // 容器元素
// path: location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname需传此参数
})
</script>
</div>
} }
Body.afterDOMLoaded = clipboardScript Body.afterDOMLoaded = clipboardScript