mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 20:13:31 +08:00
gitalk Fixed
This commit is contained in:
parent
4ff0bb910d
commit
65c57dd4a7
BIN
layouts/partials/comments/provider/.DS_Store
vendored
Normal file
BIN
layouts/partials/comments/provider/.DS_Store
vendored
Normal file
Binary file not shown.
24
layouts/partials/comments/provider/gitalk.html
Normal file
24
layouts/partials/comments/provider/gitalk.html
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{{- with .Site.Params.comments.gitalk -}}
|
||||||
|
|
||||||
|
<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
|
||||||
|
labels: ['Gitalk'] // MaxLegth:75
|
||||||
|
});
|
||||||
|
(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 }}
|
Loading…
Reference in New Issue
Block a user