gittalk Fixed

This commit is contained in:
Cookiekira 2021-09-12 21:40:28 +08:00
parent 29706856ea
commit 8837e59d51
5 changed files with 1 additions and 24 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -111,7 +111,7 @@ params:
reactionsEnabled: 1
emitMetadata: 0
gittalk:
gitalk:
owner:
admin:
repo:

BIN
layouts/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -1,23 +0,0 @@
{{- with .Site.Params.comments.gittalk -}}
<div id="gitalk-container"></div>
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
clientID: '{{- .clientID -}}',
clientSecret: '{{- .clientSecret -}}',
repo: '{{- .repo -}}',
owner: '{{- .owner -}}',
admin: ['{{- .admin -}}'],
distractionFreeMode: false // Facebook-like distraction free mode
});
(function() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
document.getElementById('gitalk-container').innerHTML = 'Gitalk comments not available by default when the website is previewed locally.';
return;
}
gitalk.render('gitalk-container');
})();
</script>
{{ end }}