mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-06-18 12:03:30 +08:00
Add gittalk
This commit is contained in:
parent
5693c4bf7a
commit
dd285cd848
@ -51,7 +51,7 @@ params:
|
||||
|
||||
comments:
|
||||
enabled: true
|
||||
provider: disqus
|
||||
provider: gittalk
|
||||
|
||||
disqusjs:
|
||||
shortname:
|
||||
@ -111,6 +111,14 @@ params:
|
||||
reactionsEnabled: 1
|
||||
emitMetadata: 0
|
||||
|
||||
gittalk:
|
||||
owner: 'Cookiekira'
|
||||
admin: 'Cookiekira'
|
||||
repo: 'gitment-comments'
|
||||
clientID: 'c2acde8bec65d6540c9a'
|
||||
clientSecret: 'cf8cdd3828f4a3e901389c3b7f3d331974644f88'
|
||||
id: location.pathname, # Ensure uniqueness and length less than 50
|
||||
|
||||
widgets:
|
||||
enabled:
|
||||
- search
|
||||
|
BIN
layouts/.DS_Store
vendored
Normal file
BIN
layouts/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
layouts/_default/.DS_Store
vendored
Normal file
BIN
layouts/_default/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
layouts/partials/.DS_Store
vendored
Normal file
BIN
layouts/partials/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
layouts/partials/comments/.DS_Store
vendored
Normal file
BIN
layouts/partials/comments/.DS_Store
vendored
Normal file
Binary file not shown.
24
layouts/partials/comments/provider/gittalk.html
Normal file
24
layouts/partials/comments/provider/gittalk.html
Normal file
@ -0,0 +1,24 @@
|
||||
{{- 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: '{{ .Gitalk.repo }}',
|
||||
owner: '{{ .owner }}',
|
||||
admin: ['{{ .owner }}'],
|
||||
id: location.pathname, // Ensure uniqueness and length less than 50
|
||||
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 }}
|
@ -18,6 +18,7 @@ features = [
|
||||
"darkmode",
|
||||
"table of contents",
|
||||
"search",
|
||||
"gitalk",
|
||||
]
|
||||
|
||||
min_version = "0.78.0"
|
||||
|
Loading…
Reference in New Issue
Block a user