feat: add giscus

This commit is contained in:
KazooTTT
2024-10-11 20:07:15 +08:00
parent d2f4fa5fec
commit 4fdafbe98a
11 changed files with 586 additions and 58 deletions

View File

@ -0,0 +1,36 @@
import React from 'react'
import Giscus from '@giscus/react'
const id = 'inject-comments'
const GiscusComment = () => {
const [mounted, setMounted] = React.useState(false)
React.useEffect(() => {
setMounted(true)
}, [])
return (
<div id={id} className='w-full'>
{mounted ? (
<Giscus
id={id}
repo='KazooTTT/kazoottt-blog'
repoId='R_kgDOMa4jRQ'
category='Announcements'
categoryId='DIC_kwDOMa4jRc4CjRFe'
mapping='pathname'
strict='0'
reactionsEnabled='1'
emitMetadata='0'
inputPosition='bottom'
theme='preferred_color_scheme'
lang='zh-CN'
loading='lazy'
/>
) : null}
</div>
)
}
export default GiscusComment