remark42.html 981 B

1234567891011121314151617181920212223242526272829
  1. {{- with .Site.Params.comments.remark42 -}}
  2. <div id="remark42"></div>
  3. <script>
  4. var remark_config = {
  5. host: "{{ .host }}",
  6. site_id: '{{ .site }}',
  7. components: ['embed'],
  8. url: "{{ $.Permalink }}",
  9. max_shown_comments: {{ default 15 .max_shown_comments }},
  10. theme: document.documentElement.dataset.scheme,
  11. page_title: '{{ $.Title }}',
  12. locale: '{{ default "en" .locale }}',
  13. show_email_subscription: {{ default true .show_email_subscription }}
  14. };
  15. (function (c) {
  16. for (var i = 0; i < c.length; i++) {
  17. var d = document, s = d.createElement('script');
  18. s.src = remark_config.host + '/web/' + c[i] + '.js';
  19. s.defer = true;
  20. (d.head || d.body).appendChild(s);
  21. }
  22. })(remark_config.components || ['embed']);
  23. window.addEventListener('onColorSchemeChange', (e) => {
  24. window.REMARK42.changeTheme(e.detail);
  25. })
  26. </script>
  27. {{- end -}}