feat: add comment system

This commit is contained in:
radishzzz 2025-03-06 23:06:38 +00:00
parent c2ebc78045
commit eabd33f339
6 changed files with 50 additions and 11 deletions

View file

@ -35,7 +35,7 @@ function initWaline() {
el: '#waline',
path: window.location.pathname.replace(/^\/([a-z]{2}(-[a-z]{2})?)\//, '/'),
dark: 'auto',
requiredMeta: ['nick'],
requiredMeta: ['nick', 'mail'],
highlighter: false,
texRenderer: false,
reaction: [],

View file

@ -0,0 +1,27 @@
---
// import Disqus from '@/components/Comments/Disqus.astro'
// import Giscus from '@/components/Comments/Giscus.astro'
// import Twikoo from '@/components/Comments/Twikoo.astro'
import Waline from '@/components/Comments/Waline.astro'
import { themeConfig } from '@/config'
// Disqus
// const disqusShortname = themeConfig.comment?.disqus?.shortname || ''
// const showDisqus = disqusShortname.trim() !== ''
// Giscus
// const giscusRepo = themeConfig.comment?.giscus?.repo || ''
// const showGiscus = giscusRepo.trim() !== ''
// Twikoo
// const twikooEnvId = themeConfig.comment?.twikoo?.envId || ''
// const showTwikoo = twikooEnvId.trim() !== ''
// Waline
const walineURL = themeConfig.comment?.waline?.serverURL || ''
const showWaline = walineURL.trim() !== ''
---
<!-- {showDisqus && <Disqus />} -->
<!-- {showGiscus && <Giscus />} -->
<!-- {showTwikoo && <Twikoo />} -->
{showWaline && <Waline />}