feat(comment): Update Waline to V2 version (#616)

*  feat(comment): 更新Waline至V2版本

* 保留placeholder属性
This commit is contained in:
luoboQAQ 2022-06-09 00:30:52 +08:00 committed by GitHub
parent 772b9e3ba8
commit 9eec31f0b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -97,21 +97,20 @@ params:
clientSecret: clientSecret:
autoCreateIssue: false 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: waline:
serverURL: serverURL:
lang: lang:
visitor: pageview:
avatar:
emoji: emoji:
- https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo - https://unpkg.com/@waline/emojis@1.0.1/weibo
requiredMeta: requiredMeta:
- name - name
- email - email
- url - url
placeholder:
locale: locale:
admin: Admin admin: Admin
placeholder:
twikoo: twikoo:
envId: envId:

View File

@ -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> <div id="waline" class="waline-container"></div>
<style> <style>
.waline-container { .waline-container {
@ -6,15 +7,16 @@
border-radius: var(--card-border-radius); border-radius: var(--card-border-radius);
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
padding: var(--card-padding); padding: var(--card-padding);
--waline-font-size: var(--article-font-size);
} }
.waline-container .vcount { .waline-container .wl-count {
color: var(--card-text-color-main); color: var(--card-text-color-main);
} }
</style> </style>
{{- with .Site.Params.comments.waline -}} {{- with .Site.Params.comments.waline -}}
{{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}} {{- $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 := . -}} {{- range $key, $val := . -}}
{{- if $val -}} {{- if $val -}}
@ -27,6 +29,6 @@
<script> <script>
/// Waline client configuration see: https://waline.js.org/en/reference/client.html /// Waline client configuration see: https://waline.js.org/en/reference/client.html
new Waline({{ $config | jsonify | safeJS }}); Waline.init({{ $config | jsonify | safeJS }});
</script> </script>
{{- end -}} {{- end -}}