hugo-toha/layouts/partials/utteranc.html
安红豆 4e029b7de8
Add utteranc comment plugin (#465)
* add comment plugin utteranc(save message to github issue)

config.yml
    # Enable comment feature. There, should be only one of them.
    comment:
      enable: true
      utteranc:
        repo: ormissia/ormissia.github.io
        issueTerm: title
        theme: github-light

* Update utteranc.html
2021-11-18 23:17:46 +06:00

22 lines
870 B
HTML

{{ $repo := site.Params.features.comment.utteranc.repo }}
{{ $issueTerm := site.Params.features.comment.utteranc.issueTerm }}
{{ $theme := site.Params.features.comment.utteranc.theme }}
<div id="utteranc_thread"></div>
<div id="comments" class="comments">
<div id="comments-container"></div>
</div>
<script type="text/javascript">
(function() {
var utterances = document.createElement('script');
utterances.type = 'text/javascript';
utterances.async = true;
utterances.setAttribute('repo','{{ $repo }}')
utterances.setAttribute('issue-term','{{ $issueTerm }}')
utterances.setAttribute('theme','{{ $theme }}')
utterances.crossorigin = 'anonymous';
utterances.src = 'https://utteranc.es/client.js';
document.getElementById('comments-container').appendChild(utterances);
})();
</script>