mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
feat(comments): disable comments when preview
This commit is contained in:
parent
4f9a6c775a
commit
bfc82d8901
@ -1,7 +1,8 @@
|
||||
<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>
|
||||
{{ if not .Site.IsServer }}
|
||||
<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 {
|
||||
background-color: var(--card-background);
|
||||
border-radius: var(--card-border-radius);
|
||||
@ -12,23 +13,24 @@
|
||||
.waline-container .wl-count {
|
||||
color: var(--card-text-color-main);
|
||||
}
|
||||
</style>
|
||||
</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" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}}
|
||||
{{- with .Site.Params.comments.waline -}}
|
||||
{{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}}
|
||||
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}}
|
||||
|
||||
{{- range $key, $val := . -}}
|
||||
{{- range $key, $val := . -}}
|
||||
{{- if ne $val nil -}}
|
||||
{{- $replaceKey := index $replaceKeys $key -}}
|
||||
{{- $k := default $key $replaceKey -}}
|
||||
|
||||
{{- $config = merge $config (dict $k $val) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
<script>
|
||||
<script>
|
||||
/// Waline client configuration see: https://waline.js.org/en/reference/client.html
|
||||
Waline.init({{ $config | jsonify | safeJS }});
|
||||
</script>
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Loading…
Reference in New Issue
Block a user