waline.html 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <script src='//cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js'></script>
  2. <div id="waline" class="waline-container"></div>
  3. <style>
  4. .waline-container {
  5. background-color: var(--card-background);
  6. border-radius: var(--card-border-radius);
  7. box-shadow: var(--shadow-l1);
  8. padding: var(--card-padding);
  9. }
  10. .waline-container .vcount {
  11. color: var(--card-text-color-main);
  12. }
  13. </style>
  14. {{- with .Site.Params.comments.waline -}}
  15. {{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}}
  16. {{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "avatarcdn" "avatarCDN" "avatarforce" "avatarForce" -}}
  17. {{- range $key, $val := . -}}
  18. {{- if $val -}}
  19. {{- $replaceKey := index $replaceKeys $key -}}
  20. {{- $k := default $key $replaceKey -}}
  21. {{- $config = merge $config (dict $k $val) -}}
  22. {{- end -}}
  23. {{- end -}}
  24. <script>
  25. /// Waline client configuration see: https://waline.js.org/en/reference/client.html
  26. new Waline({{ $config | jsonify | safeJS }});
  27. </script>
  28. {{- end -}}