mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
feat(comment): add Waline
This commit is contained in:
parent
325303a7f8
commit
4e1f769893
@ -66,6 +66,19 @@ params:
|
||||
repo:
|
||||
clientId:
|
||||
clientSecret:
|
||||
|
||||
# Waline 前端配置参见 https://waline.js.org/client/basic.html
|
||||
# Waline client configuration see: https://waline.js.org/en/client/basic.html
|
||||
waline:
|
||||
serverURL:
|
||||
placeholder:
|
||||
wordLimit:
|
||||
avatar:
|
||||
avatarCDN:
|
||||
emojiCDN:
|
||||
guest_info: "nick,mail,link"
|
||||
requiredFields:
|
||||
admin:
|
||||
|
||||
widgets:
|
||||
enabled:
|
||||
|
31
layouts/partials/comments/provider/waline.html
Normal file
31
layouts/partials/comments/provider/waline.html
Normal file
@ -0,0 +1,31 @@
|
||||
<script src='//cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js'></script>
|
||||
<div id="waline" class="waline-container"></div>
|
||||
<style>
|
||||
.waline-container {
|
||||
background-color: var(--card-background);
|
||||
border-radius: var(--card-border-radius);
|
||||
box-shadow: var(--shadow-l1);
|
||||
padding: var(--card-padding);
|
||||
}
|
||||
</style>
|
||||
|
||||
{{- with .Site.Params.comments.waline -}}
|
||||
<script>
|
||||
// 本页配置参见 https://waline.js.org/client/basic.html
|
||||
// Waline client configuration see: https://waline.js.org/en/client/basic.html
|
||||
new Waline({
|
||||
el: '#waline',
|
||||
serverURL: '{{ .serverURL }}',
|
||||
placeholder: '{{ .placeholder }}',
|
||||
wordLimit: '{{ .wordLimit }}',
|
||||
avatar: '{{ .avatar }}',
|
||||
avatarCDN: '{{ .avatarCDN }}',
|
||||
emojiCDN: '{{ .emojiCDN }}',
|
||||
guest_info: '{{ .guest_info }}',
|
||||
requiredFields: '{{ .requiredFields }}',
|
||||
langMode: {
|
||||
admin: '{{ .admin }}'
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{{- end -}}
|
Loading…
Reference in New Issue
Block a user