fuwari/src/components/comment/Giscus.astro
Moeyua 8e20106df5
feat: add comment component and comment configuration (#37)
*  feat: Add comment component and comment configuration

* chore: rebuild pnpm-lock

---------

Co-authored-by: saicaca <zephyird@gmail.com>
2024-06-21 19:53:34 +08:00

31 lines
654 B
Text

---
import { commentConfig } from '@/config'
if (!commentConfig || !commentConfig.giscus) {
throw new Error('Giscus comments are not configured')
}
const giscus = commentConfig.giscus
---
<giscus-widget
id="comments"
repo={giscus.repo}
repoId={giscus.repoId}
category={giscus.category}
categoryId={giscus.categoryId}
mapping={giscus.mapping}
term={giscus.term}
strict={giscus.strict}
reactionsEnabled={giscus.reactionsEnabled}
emitMetadata={giscus.emitMetadata}
inputPosition={giscus.inputPosition}
theme={giscus.theme}
lang={giscus.lang}
loading={giscus.loading}
>
</giscus-widget>
<script>
import 'giscus'
</script>