Add support for utterances (#1966)
* Add support for utterances * Add utterances config documentation * Update CHANGELOG and history Close #1909
This commit is contained in:
@ -12,6 +12,8 @@
|
||||
{% include /comments-providers/staticman.html %}
|
||||
{% when "staticman_v2" %}
|
||||
{% include /comments-providers/staticman_v2.html %}
|
||||
{% when "utterances" %}
|
||||
{% include /comments-providers/utterances.html %}
|
||||
{% when "custom" %}
|
||||
{% include /comments-providers/custom.html %}
|
||||
{% endcase %}
|
||||
|
20
_includes/comments-providers/utterances.html
Normal file
20
_includes/comments-providers/utterances.html
Normal file
@ -0,0 +1,20 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
(function() {
|
||||
var commentContainer = document.querySelector('#utterances-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', '{{ site.comments.utterances.theme | default: "github-light" }}');
|
||||
script.setAttribute('crossorigin', 'anonymous');
|
||||
|
||||
commentContainer.appendChild(script);
|
||||
})();
|
||||
</script>
|
@ -165,6 +165,9 @@
|
||||
<!-- End new comment form -->
|
||||
{% endif %}
|
||||
</section>
|
||||
{% when "utterances" %}
|
||||
<h4 class="page__comments-title">{{ comments_label }}</h4>
|
||||
<section id="utterances-comments"></section>
|
||||
{% when "custom" %}
|
||||
<section id="custom-comments"></section>
|
||||
{% endcase %}
|
||||
|
Reference in New Issue
Block a user