mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
feat(comment): Update Waline to V2 version (#616)
* ✨ feat(comment): 更新Waline至V2版本
* 保留placeholder属性
This commit is contained in:
parent
772b9e3ba8
commit
9eec31f0b6
2 changed files with 10 additions and 9 deletions
|
@ -97,21 +97,20 @@ params:
|
|||
clientSecret:
|
||||
autoCreateIssue: false
|
||||
|
||||
# Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||
# Waline client configuration see: https://waline.js.org/en/reference/component.html
|
||||
waline:
|
||||
serverURL:
|
||||
lang:
|
||||
visitor:
|
||||
avatar:
|
||||
pageview:
|
||||
emoji:
|
||||
- https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo
|
||||
- https://unpkg.com/@waline/emojis@1.0.1/weibo
|
||||
requiredMeta:
|
||||
- name
|
||||
- email
|
||||
- url
|
||||
placeholder:
|
||||
locale:
|
||||
admin: Admin
|
||||
placeholder:
|
||||
|
||||
twikoo:
|
||||
envId:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<script src='//cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js'></script>
|
||||
<script src='//unpkg.com/@waline/client@v2/dist/waline.js'></script>
|
||||
<link href='//unpkg.com/@waline/client@v2/dist/waline.css' rel='stylesheet'/>
|
||||
<div id="waline" class="waline-container"></div>
|
||||
<style>
|
||||
.waline-container {
|
||||
|
@ -6,15 +7,16 @@
|
|||
border-radius: var(--card-border-radius);
|
||||
box-shadow: var(--shadow-l1);
|
||||
padding: var(--card-padding);
|
||||
--waline-font-size: var(--article-font-size);
|
||||
}
|
||||
.waline-container .vcount {
|
||||
.waline-container .wl-count {
|
||||
color: var(--card-text-color-main);
|
||||
}
|
||||
</style>
|
||||
|
||||
{{- with .Site.Params.comments.waline -}}
|
||||
{{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}}
|
||||
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "avatarcdn" "avatarCDN" "avatarforce" "avatarForce" -}}
|
||||
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}}
|
||||
|
||||
{{- range $key, $val := . -}}
|
||||
{{- if $val -}}
|
||||
|
@ -27,6 +29,6 @@
|
|||
|
||||
<script>
|
||||
/// Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||
new Waline({{ $config | jsonify | safeJS }});
|
||||
Waline.init({{ $config | jsonify | safeJS }});
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
|
Loading…
Reference in a new issue