mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
#200#issuecomment-860025299
This commit is contained in:
parent
eebd5ade09
commit
ea0bdeca5d
@ -70,15 +70,20 @@ params:
|
|||||||
# Waline 前端配置参见 https://waline.js.org/reference/client.html
|
# Waline 前端配置参见 https://waline.js.org/reference/client.html
|
||||||
# Waline client configuration see: https://waline.js.org/en/reference/client.html
|
# Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||||
waline:
|
waline:
|
||||||
serverURL:
|
serverURL:
|
||||||
lang:
|
lang:
|
||||||
visitor:
|
visitor:
|
||||||
avatar:
|
avatar:
|
||||||
emoji:
|
emoji:
|
||||||
dark: auto
|
- emoji URL 1
|
||||||
admin:
|
- emoji URL 2
|
||||||
requiredMeta:
|
requiredMeta:
|
||||||
|
- name
|
||||||
|
- email
|
||||||
|
- url
|
||||||
placeholder:
|
placeholder:
|
||||||
|
locale:
|
||||||
|
admin: test
|
||||||
|
|
||||||
widgets:
|
widgets:
|
||||||
enabled:
|
enabled:
|
||||||
|
@ -7,25 +7,26 @@
|
|||||||
box-shadow: var(--shadow-l1);
|
box-shadow: var(--shadow-l1);
|
||||||
padding: var(--card-padding);
|
padding: var(--card-padding);
|
||||||
}
|
}
|
||||||
|
.waline-container .vcount {
|
||||||
|
color: var(--card-text-color-main);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{{- with .Site.Params.comments.waline -}}
|
{{- with .Site.Params.comments.waline -}}
|
||||||
<script>
|
{{- $config := dict "el" "#waline" "dark" "body[data-scheme=\"dark\"]" -}}
|
||||||
// 本页配置参见 https://waline.js.org/reference/client.html
|
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "avatarcdn" "avatarCDN" "avatarforce" "avatarForce" -}}
|
||||||
// Waline client configuration see: https://waline.js.org/en/reference/client.html
|
|
||||||
new Waline({
|
{{- range $key, $val := . -}}
|
||||||
el: '#waline',
|
{{- if $val -}}
|
||||||
serverURL: '{{ .serverURL }}',
|
{{- $replaceKey := index $replaceKeys $key -}}
|
||||||
lang: '{{ .lang }}',
|
{{- $k := default $key $replaceKey -}}
|
||||||
visitor: '{{ .visitor }}',
|
|
||||||
avatar: '{{ .avatar }}',
|
{{- $config = merge $config (dict $k $val) -}}
|
||||||
emoji: ['{{ .emoji }}'],
|
{{- end -}}
|
||||||
dark: '{{ .dark }}',
|
|
||||||
requiredMeta: ['{{ .requiredMeta }}'],
|
|
||||||
locale: {
|
|
||||||
admin: '{{ .admin }}',
|
|
||||||
placeholder: '{{ .placeholder }}',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/// Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||||
|
new Waline({{ $config | jsonify | safeJS }});
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
Loading…
Reference in New Issue
Block a user