mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
feat: add waline comment
This commit is contained in:
parent
fef42675c0
commit
fa148ca0c5
10 changed files with 135 additions and 26 deletions
37
src/components/Comments/Waline.astro
Normal file
37
src/components/Comments/Waline.astro
Normal file
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
import { themeConfig } from '@/config'
|
||||
|
||||
const {
|
||||
serverURL = '',
|
||||
emoji = [],
|
||||
searchGif = false,
|
||||
imageUploader = false,
|
||||
} = themeConfig.comment?.waline ?? {}
|
||||
---
|
||||
{serverURL && (
|
||||
<>
|
||||
<link rel="stylesheet" href="https://unpkg.com/@waline/client@v3/dist/waline.css" />
|
||||
<div id="waline"></div>
|
||||
<script
|
||||
is:inline
|
||||
type="module"
|
||||
define:vars={{ serverURL, emoji, searchGif, imageUploader }}
|
||||
>
|
||||
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js'
|
||||
|
||||
init({
|
||||
el: '#waline',
|
||||
serverURL,
|
||||
lang: 'zh',
|
||||
emoji,
|
||||
dark: 'auto',
|
||||
requiredMeta: ['nick'],
|
||||
imageUploader: false,
|
||||
highlighter: false,
|
||||
texRenderer: false,
|
||||
search: searchGif,
|
||||
reaction: false,
|
||||
})
|
||||
</script>
|
||||
</>
|
||||
)}
|
Loading…
Add table
Add a link
Reference in a new issue