Skip to content

Support for utterances #1909

Closed
Closed
@chatoo2412

Description

@chatoo2412

Summary

Please support for utterances.

Motivation

utterances is a lightweight comments widget built on GitHub issues, a good alternative for Staticman.

Drawbacks

none

Implementation

utterances can be integrated by custom comments provider.
It would be better if it's supported by the theme officially.

demo: https://chatoo2412.github.io/blog/start-blog/

# _config.yml

comments:
  provider: custom
<!-- _includes/comments-providers/custom.html -->

<script>
  'use strict';

  (function() {
    var commentContainer = document.querySelector('#custom-comments');

    if (!commentContainer) {
      return;
    }

    var script = document.createElement('script');
    script.setAttribute('src', 'https://utteranc.es/client.js');
    script.setAttribute('repo', '{{ site.repository }}');
    script.setAttribute('issue-term', 'pathname');
    script.setAttribute('theme', 'github-light');
    script.setAttribute('crossorigin', 'anonymous');

    commentContainer.appendChild(script);
  })();
</script>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions