twikoo.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script src="//cdn.jsdelivr.net/npm/twikoo@1.4.18/dist/twikoo.all.min.js"></script>
  2. <div id="tcomment"></div>
  3. <style>
  4. .twikoo {
  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. :root[data-scheme="dark"] {
  11. --twikoo-body-text-color-main: rgba(255, 255, 255, 0.9);
  12. --twikoo-body-text-color: rgba(255, 255, 255, 0.7);
  13. }
  14. .twikoo .el-input-group__prepend,
  15. .twikoo .tk-action-icon,
  16. .twikoo .tk-time,
  17. .twikoo .tk-comments-count {
  18. color: var(--twikoo-body-text-color);
  19. }
  20. .twikoo .el-input__inner,
  21. .twikoo .el-textarea__inner,
  22. .twikoo .tk-preview-container,
  23. .twikoo .tk-content,
  24. .twikoo .tk-nick,
  25. .twikoo .tk-send {
  26. color: var(--twikoo-body-text-color-main);
  27. }
  28. .twikoo .el-button{
  29. color: var(--twikoo-body-text-color)!important;
  30. }
  31. </style>
  32. {{- with .Site.Params.comments.twikoo -}}
  33. <script>
  34. twikoo.init({
  35. envId: '{{- .envId -}}',
  36. el: '#tcomment',
  37. {{- with .region -}}
  38. region: '{{- . -}}',
  39. {{- end -}}
  40. {{- with .path -}}
  41. path: '{{- . -}}',
  42. {{- end -}}
  43. {{- with .lang -}}
  44. lang: '{{- . -}}',
  45. {{- end -}}
  46. })
  47. </script>
  48. {{- end -}}